wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Yup... another one! JDK, Javac, etc :) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Yup... another one! JDK, Javac, etc :)" Watch "Yup... another one! JDK, Javac, etc :)" New topic
Author

Yup... another one! JDK, Javac, etc :)

Besjamain Greenaway
Ranch Hand

Joined: Dec 21, 2007
Posts: 45
I've waded through the topics here on the forum, on sun's website, and on/offline documentation here and there, but have not gotten an answer that could get me make a step forward.

I have a laptop with Vista (the humanity!) and first wanted to download a JDK to get started on my Head First Java. It took me a while to figure out what Java 1.6.0 and Java 6 is (the same), and then I spent quite some time figuring out wich version I should take. Version 3, netbeans version, umbrella version, "let's make your life even more difficult with yet another" -version, etc. In the end I just closed my eyes and clicked :-) So, now I have Java JDK 6 (1.6.0) version 3, and then I ended up searching where the frick it was in my start menu>programs. Turns out there isn't a GUI for it, and it was hidden in the bowels of Vista.

Anyways, I made a map, and put my helloworldapp.java in it. As in the example on the sun website to make a class out of it, I went to the command line, and typed the line in. Got a message; 'javac' is not recognized as an internal or external command,
operable program or batch file.


Did some searching, lots of reading, and ended up at sun's "path variabels" documentation. This is what I put in:

Variable name: Java
Variable value: C:\Program Files\Java\jdk1.6.0_03\bin

for both the user and system variables. In the command prompt I looked up my helloworldapp.java file, and put javac in front of it, but, to no avail again; same message...

What am I doing wrong? It seems like university is needed to get started on Java
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
Originally posted by B Gr:
Anyways, I made a map, and put my helloworldapp.java in it. As in the example on the sun website to make a class out of it, I went to the command line, and typed the line in. Got a message; 'javac' is not recognized as an internal or external command, operable program or batch file.

Did some searching, lots of reading, and ended up at sun's "path variabels" documentation. This is what I put in:

Variable name: Java
Variable value: C:\Program Files\Java\jdk1.6.0_03\bin

for both the user and system variables. In the command prompt I looked up my helloworldapp.java file, and put javac in front of it, but, to no avail again; same message...


I'm not quite sure what you mean by "I made a map...", but regarding "path variables", the Variable name is PATH. I'm sure you already have an environment variable by that name. You want to add to the PATH, not replace it. So find "PATH" in your variables and edit it to put C:\Program Files\Java\jdk1.6.0_03\bin; in front of the stuff that's already there (including the semicolon).
Then you open the command prompt and cd (change directory) to the location of your helloworldapp.java file. For example, cd C:\Java and type javac helloworldapp.java (so you see C:\>javac helloworldapp.java)
When you get your command prompt back, you type java helloworldapp (C:\>java helloworldapp)
[ December 21, 2007: Message edited by: Marilyn de Queiroz ]

JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Besjamain Greenaway
Ranch Hand

Joined: Dec 21, 2007
Posts: 45
Thank you very much After a good night sleep my brains felt rejuvenated, and got it working thanks to your explanation!
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

"B Gr", please check your private messages. You can see them by clicking My Private Messages.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Doug Appleman
Greenhorn

Joined: Jan 04, 2008
Posts: 1
To change the path environment variable in Vista:

1. Click Start and choose Control Panel
2. In the Search box on the top right of the window type �system path� (no quotes)
3. Click �Edit the system environment variables�
4. The Advanced tab of the System Properties dialog box is shown. Click the Environment Variables button on the bottom right.
5. In the lower box titled �System Variables� scroll down to Path and click the Edit button.
6. Change your path as need be.
7. Restart your system. The system path environment variable change will not be in effect until the computer is restarted.
 
Don't get me started about those stupid light bulbs.
 
subject: Yup... another one! JDK, Javac, etc :)
 
Similar Threads
-classpath command revisited
Compiler Not Found, Despite Installing JDK
Many Problems Compiling HelloWorld.java
"javac HelloWorldApp.java" not recognized, but "java -version" recognized
Cant run apps[help]