• Post Reply Bookmark Topic Watch Topic
  • New Topic

New One Win10  RSS feed

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there, i'm new one on starting, i got problem with Win10, doing step by step to make moosegreetings, but it's failuring me on each step, can't get every think with Java installation and path, can some explain how it do not on XP,7 or Vista, but on 10 ?

Sorry in case if it is stupid question....
 
Master Rancher
Posts: 1251
36
Android Chrome IntelliJ IDE Java MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to CodeRanch Kristaps,

I hope that you find the community here knowledgeable, sharing and welcoming.

From the command line, what do you get when you run the following command?
java -version
If you get something like command not recognized then you probably do not have Java setup in your path correctly.
However if you get something like
java version "9.0.1"
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)

Then you are all set and good to go. You version could vary depending on what you have installed on your system.

What is you current Java Home?
You can find this out from the command prompt by running this command
echo %java_home%
It should be something like C:\Program Files\Java\jdk-9
If you do not have the Java Home defined then you may be okay, then again you may not be okay.

Next, what do you have setup in for the path?
You can find this out from the command prompt by running this command
echo %path%
Chances are that there will be a lot returned with the command. However you should have something like C:\Program Files\Java\jdk-9\bin\ listed with everything else that is returned.

Here are the basic steps involved with setting/creating/modifying the environment variables https://www.computerhope.com/issues/ch000549.htm#windows8.

Anytime you change the environment variables you will need to close the command prompt and start a new one for the changes to be recognized.

Looking for where Java is installed? You can use the where command from the command line
where java.exe
You can have Java installed in many different locations on the same system at the same time.

Let me know how you make out.
 
Marshal
Posts: 5479
377
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pete, have a cow for continuous efforts and help. I'm sure that is why community is known as so sharing and welcoming
 
Pete Letkeman
Master Rancher
Posts: 1251
36
Android Chrome IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the cow Liutauras. I'm just trying to do what I can to help out.

We all started somewhere and hopefully my previous post helps out Kristaps.
Or at least we can work out this issue together to get Kristaps off and running.
 
Kristaps Balodis
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Liutauras Vilda wrote:Pete, have a cow for continuous efforts and help. I'm sure that is why community is known as so sharing and welcoming

-.png
[Thumbnail for -.png]
cmd
 
Kristaps Balodis
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And on moosegreetings all the time is this problem... Can't understand why....

Microsoft Windows [Version 10.0.16299.125]
(c) Корпорация Майкрософт (Microsoft Corporation), 2017. Все права защищены.

C:\Users\User>C:\>cd\java\src
Системе не удается найти указанный путь.

C:\Users\User>C:\>cd\java\src>javac MooseGreetings.java
"C:\" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.

C:\Users\User>C:\>cd\java\javac MooseGreetings.java
Системе не удается найти указанный путь.

C:\Users\User>c:\<cd\java
Системе не удается найти указанный путь.

C:\Users\User>java -classpath. MooseGreetings
Unrecognized option: -classpath.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

C:\Users\User>
 
Liutauras Vilda
Marshal
Posts: 5479
377
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wait.

When you say "And on moosegreetings all the time is this problem". So that means on something else all work fine. You should have told us earlier that.

I see you are trying to set classpath to current working directory, but you don't place space before it.

C:\Users\User>java -classpath. MooseGreetings


See the problem?
 
Liutauras Vilda
Marshal
Posts: 5479
377
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

C:\Users\User>C:\>cd\java\src


No space after cd either.

Remind yourself basic command prompt commands.
 
Liutauras Vilda
Marshal
Posts: 5479
377
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

C:\Users\User>C:\>cd\java\src>javac MooseGreetings.java


What is that underlined bit '>' (I underlined to emphasise) ?
 
Pete Letkeman
Master Rancher
Posts: 1251
36
Android Chrome IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looking at the screen shot provided it looks like the java_home on your system is not set correctly.
It should probably be set to
C:\Program Files\Java\JDK-9
providing this is where you have the JDK installed on your system, which I can make out looking at the screen shot provided.

Do you have Java installed to this location C:\Java\JDK-9 as well?

This could be part of the reason that some times some Java related things work and some times they do not.

What are the results of running the following command from the command prompt:
where java.exe
This should tell us at least one location where Java is installed.
 
Kristaps Balodis
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Pete Letkeman wrote:Looking at the screen shot provided it looks like the java_home on your system is not set correctly.
It should probably be set to
C:\Program Files\Java\JDK-9
providing this is where you have the JDK installed on your system, which I can make out looking at the screen shot provided.

Do you have Java installed to this location C:\Java\JDK-9 as well?

This could be part of the reason that some times some Java related things work and some times they do not.

What are the results of running the following command from the command prompt:
where java.exe
This should tell us at least one location where Java is installed.



Yes it's in both place's C:\Java\JDK-9 and C:\Program Files\Java and guess in C:\Program Files(x84)\Java in both are jre1.8.0_151 
On command "where java.exe" it's shown next one ...
C:\Users\User>where java.exe
C:\ProgramData\Oracle\Java\javapath\java.exe


Try'd all kind about "C:\>cd\java\src_javac MooseGreetings.java" all what cmd it's whon it's:
C:\Users\User>C:\cd>\java\src_javac MooseGreetings.java
'C:\cd' is not recognized as an internal or external command,
operable program or batch file.
 
Liutauras Vilda
Marshal
Posts: 5479
377
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Kristaps Balodis wrote:Try'd all kind about "C:\>cd\java\src_javac MooseGreetings.java" all what cmd it's whon it's:
C:\Users\User>C:\cd>\java\src_javac MooseGreetings.java
'C:\cd' is not recognized as an internal or external command,
operable program or batch file.


Dude, I've mentioned already, look at the commands you are typing.
 
Pete Letkeman
Master Rancher
Posts: 1251
36
Android Chrome IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please take a few moment and recognize that you are using invalid commands at the command prompt as Liutauras has previously stated.

Given all of the preceding post, it does appear as though you do have Java installed, and most Java operations do work.

However here are a few things that you could to to clean up Java on your system, given what you have previously stated.

  • Do you have any explicit reasons for having more then one version or instance of Java installed on your system?
         If you do not then perhaps it best that you only have one installed at this point.
         You can always add more Java installations later after you get your problems resolved.
         Java 9 supports most programs created which targeted Java 8 with little to no modification.
  • Your where java.exe is not returning what I would have expected given what you tell me.
         You said that you have Java installed in two different locations.
         So I would expect where java.exe to be found at least two different times in at least two locations.
         However where java.exe is only finding one of them.
  • It also appears as though Java 9 is setup, found by running java -version.
         Yet you stated that you have it set it up in the directory normally used by Java 8.

  • ---------------------------------------
    If you are wiling to start from the very beginning you can follow these steps, which I suspect should take less than 60 minutes or so.
    Possibly more, depending on how long it would take to reboot your computer and how slow your connection to the Internet is.

    To start from beginning:
    1) Uninstall Java, how to found here.
        Java even supplies a uninstall tool to which you can use.
    2) Remove any the java_home environment variable from your system
    3) Remove Java from the path environment variables on your system
    4) Reboot you system after uninstalling Java.
    5) If you think that you may need Java 8 then download and install Java 8 for your system.
    6) If you think that you may need Java 9 then download and install Java 9 for your system.
        Currently Java 9 is the most recent version of Java.
    7) Set the java_home environment variable to location where Java 9 JDK is installed e.g. C:\Program Files\Java\jdk-9.
        Or, if you are only using Java 8 then set java_home environment variable to the location where the Java 8 JDK is installed
    8) Add the location of the Java 9 JDK bin to your path environment variable C:\Program Files\Java\jdk-9\bin\ (where you can find java.exe)
        Or, if you are only using Java 8 then set path environment variable to the location where the Java 8 JDK bin directory is (where you can find java.exe)
    The above steps may seem drastic, and I do agree and no you do not have to follow any of them.
    ---------------------------------------

    Please let me know how you make out and I will try to assist you more.
     
    You don't like waffles? Well, do you like this tiny ad?
    Thread Boost - a very different sort of advertising
    https://coderanch.com/t/674455/Thread-Boost-feature
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!