Two Laptop Bag
The moose likes Mac OS and the fly likes Setting the Path on Macs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » Mac OS
Bookmark "Setting the Path on Macs" Watch "Setting the Path on Macs" New topic

Setting the Path on Macs

Kira Summerton

Joined: May 31, 2011
Posts: 1
Okay, so i am really new to Java. I am teaching myself and i cannot figure out how to set my PATH. I am using Head First Java and would really appreciate some help on where and how to insert the % javac on my Mac.

Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11778

You should not need to do anything manually - Macintosh OS/X comes with Java pre-installed.

Open up the Terminal application, and type java -version You should see a response that indicates what version of Java is running by default on your Mac.

The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

But for future reference for setting OS environment variables. (this includes PATH)

Mac OS is based on Unix, so the way you do environment variables are different from windows. You can use your .profile file in your user's home directory, or you can create them directly on the command line for the length that the terminal window is open.

In all cases it is a matter or using EXPORT

EXPORT my_var=someValue

for example this is part of my .profile file

Hope that helps


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: Setting the Path on Macs
It's not a secret anymore!