8

I have javac complier installed on my mac mashine. By default its version is 7. I want to set complier version to 6 by default. How do I do it on Mac?

Ive found simular solution for ubuntu: http://bartling.blogspot.com/2007/03/getting-java-6-to-be-default-jvm-on.html

Lee Taylor
  • 7,761
  • 16
  • 33
  • 49
pleerock
  • 18,322
  • 16
  • 103
  • 128

2 Answers2

8

$ export JAVA_HOME=/usr/libexec/java_home -v '1.6*'

TheWhiteRabbit
  • 15,480
  • 4
  • 33
  • 57
0

Run a command which exports your configuration:

export JAVA_HOME=/usr/libexec/java_home -v '1.6*'

This would last only until you restart your computer, so be sure to include it to your configuration as well. I'm not an OSX user so I'm not sure how exactly is the file called, but it's basically and equivalent of ".bashrc" on Linux. Just put the export line on the end of the file, so it will export it every time in future. (It's probably the same file because they're both UNIX based)

Dropout
  • 13,653
  • 10
  • 56
  • 109