Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Setting up Java

 
Mathew Miller
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got a book titled "Head First Java" which seems to be a really cool way to learn Java, under the "what you need for this book" section they let you know that you need J2SDK along w/ API documentation. I have these things, however something confuses me. The book says the following:

"You need to add an entry to your PATH enviroment variable that points to the /bin directory inside the main Java directory."

I need this in order to run the javac compiler, and I have no idea how to add this entry. Some insight would be great, thanks.
 
Billybob Marshall
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It depends on your operating system.
Assuming Windows XP:
Right-click "My Computer" desktop icon, select "Properties" menu item.
On System Properties dialog box, select "Advanced" tab.
Click "Environment Variables" button.
In "System variables" section, find the variable named Path (or PATH). Edit it as desired.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mathew,

Welcome to JavaRanch!

For instructions on setting the PATH variable, see step 5 in Sun's installation instructions. (I'm assuming that you're using Windows.)
 
Mathew Miller
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your help, it seems that I was already set to the /bin directory.
 
Mathew Miller
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well the book tells me to only use a text editor (wordpad in my case) until I learn some of the basics. If I'm not using Eclipse or Netbeans, where is this command line that I'm supposed to type %javac into in order to compile stuff? I think I'll be able to float once I figure this out.
 
Billybob Marshall
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Again, it depends on your operating system.
Windows XP: Start menu, "Run" item, "cmd"

You really need to become more familiar with your computer and OS to be successful. I'd suggest you do that.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should also be able to find it under "Start / Programs / Accessories / Command Prompt." I suggest making a shortcut to this, since you're going to be using it a lot.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And don't type the "%" character -- that's the system prompt on a Macintosh. On your machine, the prompt probably looks like "C:\MYDIR\>" or similar. Mentally substitute!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic