• Post Reply Bookmark Topic Watch Topic
  • New Topic

Brand Spankin New: Setting the JAVA_HOME and PATH environment variables  RSS feed

 
lexria lew
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using Head First JAVA and a mac

Road block sentence: "Once you've downloaded...you need to add an entry to you're PATH environment variable that points to the /bin directory inside the main Java directory."

I have no idea what that sentence is telling me to do.

1.) What is the PATH environment variable?
1a.) Where and how do I mess with it?

2.) Is this really necessary? Or can I just start working with textedit like it wants me to?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

It's been such a long time that I set up my Mac that I don't remember if I did this, but looking at my setup, I suspect I didn't. The way to test whether you need to do something is: open the Terminal.app and type "which javac". If it comes back with something like "/usr/bin/javac" then you're good to go. If it comes back with "javac: command not found" then you'd need to fiddle around with the PATH.

PATH, by the way, tells the OS where to find executables: https://www.cs.purdue.edu/homes/cs348/unix_path.html. It is not to be confused with CLASSPATH, which tells Java where to find certain classes.
 
lexria lew
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yay thanks I got "/usr/bin/javac"
 
Campbell Ritchie
Marshal
Posts: 56593
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome again

Yes, /usr/bin/javac sounds good. Also try both the following instructions:-Tell us the version numbers; 1.7.0_51 is the most recent.
 
lexria lew
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have "1.7.0_51" thanks!
 
Campbell Ritchie
Marshal
Posts: 56593
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1.7.0_51 for both? That sounds good
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!