aspose file tools*
The moose likes Beginning Java and the fly likes Creating a PATH? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Creating a PATH?" Watch "Creating a PATH?" New topic
Author

Creating a PATH?

Theo Rabke
Greenhorn

Joined: Nov 15, 2010
Posts: 2
I need help with this: (From Head First Java 2nd Edition)

Once you've downloaded and unpacked/zipped/whatever (Im using win XP), you need to add an entry to your PATH environment variable that points to the /bin directory inside the main Java directory.

Doing this: % javac

needs to let CMD find the javac compiler.


This is kind of embarrassing, because I can't even get through the intro in my JAVA book, but I am VERY new to this (started about 20 minutes ago).

Also, if you think I should be learning from a different book, then tell me BEFORE I delve deeply into this one (HEAD FIRST JAVA).

Thanks Again


I'm 14, so CMD Line is a little before my time.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

This tutorial should help you get over this.


[My Blog]
All roads lead to JavaRanch
sean parsons
Ranch Hand

Joined: Oct 18, 2010
Posts: 34
Head First Java is the book im reading aswell, and i had to change my path aswell to get things on the CMD line flowing, i hope you enjoy the book i know i am!


Wants to change the world....
Theo Rabke
Greenhorn

Joined: Nov 15, 2010
Posts: 2
Thanks for the fast reply. Worked like a charm. Do you think that the book I am using is fine?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Theo Rabke wrote:Do you think that the book I am using is fine?

Yes.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38340
    
  23
. . . and welcome to JavaRanch
Chad Kusuno
Greenhorn

Joined: Nov 17, 2010
Posts: 8
I'm having a similar problem creating the Path. I'm reading Head First Java 2nd Edition. Using Windows 7.

I've followed the directions posted on the "How to create your first java program". However, the Path (shown below) seems to go through Program Files (x86). My jdk1.6.0_23 is in the Program Files. No (x86)

%JAVA_HOME%\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\QuickTime\QTSystem\

I've deleted the (x86) from the Path and it seems to work fine. I'm just wondering if there are any bad consequences for doing this? Should I create a new path instead of the one already there? Should I do the same for the classPath?

Thanks for all your help!
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

I'm not sure I understand. Did you try to enclose your path with double quotations ? ("C:\Program Files\...")
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3611
    
  14

This is most interesting, especially since the only path you have changed is that of QuickTime.

Do Oracle and and Apple have some relations we should know about?
Chad Kusuno
Greenhorn

Joined: Nov 17, 2010
Posts: 8
No. I input the Path just as the instructions said. However, when enter "javac -version" in the in the cmd line it would state "is not recognized". This was because the Path was reading from the Program Files (x86) file. I have the jdk1.6.0_23 saved in the Program File file. Once I changed the Path to the Program File things seems to work fine. I'm just wondering if there are any consequences to doing this and if the ClassPath file needs to read from the Program File as well? This is a Program File (x86) vs Program File issue I believe. I don't know if the previous version of the jdk were 32 bit vs the current 64 bit version and if this even matters?
Chad Kusuno
Greenhorn

Joined: Nov 17, 2010
Posts: 8
I have no clue why Quicktime was in the Path name? You can probably tell I have no clue what I am doing. Any help would be awesome. Thanks.
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3611
    
  14

PATH is not Java specific. Cmd uses it to search for relative paths. Apparently QuickTime adds another value to it.

Every value is separated by a semicolon. The value you want is %JAVA_HOME%\bin. %JAVA_HOME% is another environment variable, which specifies the path of your Java installation. Look for another variable named JAVA_HOME (not PATH) and set its value to the path of your jdk (the parent folder of the bin folder you have java.exe, javac.exe etc in).
Chad Kusuno
Greenhorn

Joined: Nov 17, 2010
Posts: 8
yes i did this.

Variable: JAVA_HOME
Variable value: C:\Program Files\Java\jdk1.6.0_23

However, the Path would go to the C:\Program Files (x86) instead of the Program Files where my jdk is located.

Could the fact that I also have JRE installed in the C:\Program Files (x86)\Java folder be messing up the Path?
Chad Kusuno
Greenhorn

Joined: Nov 17, 2010
Posts: 8
Thanks for the help. I figured out my mistake. What a greenhorn!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Creating a PATH?