Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Setting the Path on Macs

 
Kira Summerton
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Thanks!
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11877
195
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic