Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating a PATH?

 
Theo Rabke
Greenhorn
Posts: 2
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This tutorial should help you get over this.
 
sean parsons
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Theo Rabke
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the fast reply. Worked like a charm. Do you think that the book I am using is fine?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Theo Rabke wrote:Do you think that the book I am using is fine?

Yes.
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
. . . and welcome to JavaRanch
 
Chad Kusuno
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure I understand. Did you try to enclose your path with double quotations ? ("C:\Program Files\...")
 
Stephan van Hulst
Bartender
Pie
Posts: 5590
54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 5590
54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the help. I figured out my mistake. What a greenhorn!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic