Sunday, November 24, 2019

How To Laid Upward Java_Home (Path) Inwards Mac Bone X 10.10 Yosemite

You tin laid upwards JAVA_HOME inwards Mac OS X 10,10 or Yosemite yesteryear adding next ascendance inwards your /.bash_profile file, every bit shown below:

export JAVA_HOME=`/usr/libexec/java_home` (remember backticks)
or
echo export "JAVA_HOME=\$(/usr/libexec/java_home -v 1.7)" >>  /.bash_profile

This volition append export "JAVA_HOME=\$(/usr/libexec/java_home -v 1.7)" into your bash_profile file. If yous conduct maintain set JAVA_HOME inwards UNIX too thus it's just similar to that.

Apple's Mac OS X is the mo most widely used operating organisation later Windows too no surprise that many Java programmer operate Macbook Pro for Java development. Mac's UNIX-like characteristic is added wages because most of the existent footing Java servers runs on UNIX-based systems e.g. Linux or Solaris. In lodge to run Java, ii things are most important, PATH too CLASSPATH.

In lodge to operate Java from the ascendance line, yous also necessitate to define JAVA_HOME or JRE_HOME, many Java-based programs too tools operate these surroundings variables to access Java e.g. Maven, Tomcat or Eclipse. Since Java is an optional parcel on the latest version of OS X, starting from OSX 10.7 (Lion), yous necessitate to either install Oracle JDK or select this optional package.




In this article, yous volition larn how to laid upwards JAVA_HOME surroundings variable inwards dissimilar Mac OS X versions e.g.

Mac OS X 10.7 Lion
Mac OS X 10.8 Mountain Lion
Mac OS X 10.9 Mavericks
Mac OS X 10.10 Yosemite
Mac OS X 10.11 El Capitan (Beta)

Actually steps are just same (if yous are running on Mac version greater than 10.6), yous don't necessitate to create anything special depending upon your version e..g Mavericks or Yosemite. You tin follow same steps to laid upwards JAVA_HOME surroundings variable. Just retrieve to operate selection -v to laid upwards JAVA_HOME to a especial version of JDB, of course, it's solely useful if yous conduct maintain multiple JDK installed on your MacBook Pro.

 or Yosemite yesteryear adding next ascendance inwards your  How to laid upwards JAVA_HOME (PATH) inwards Mac OS X 10.10 Yosemite


How to laid upwards JAVA_HOME to JDK 1.7 inwards MAC OS X 10.10 Yosemite

If yous conduct maintain installed Oracle JDK 1.6 too thus yous tin follow these steps to betoken JAVA_HOME surroundings variable to that JDK:

1) Open a concluding window

2) Open /.bash_profile file too add together below line:

export JAVA_HOME="$(/usr/libexec/java_home -v 1.7)"
or

export JAVA_HOME=`/usr/libexec/java_home -v 1.7`


3) Close the concluding too opened upwards novel one, thus that your JAVA_HOME modify takes effect. Alternative yous tin also do

$ source  /.bash_profile 

to import novel surroundings variables.

Similarly, if yous desire to laid upwards your JAVA_HOME to betoken to JDK 8 yous tin add together next lines to your bash_profile file:

export JAVA_HOME="$(/usr/libexec/java_home -v 1.8)"  or export JAVA_HOME=`/usr/libexec/java_home -v 1.8`

In short, yous tin specify the JDK version using -v selection of java_home, of course, yous necessitate to download too install corresponding JDK version.


That's all almost how to laid upwards JAVA_HOME surroundings variable inwards Mac OS X system. From version 10.6 onward, it's recommended to laid upwards JAVA_HOME variable using /usr/libexec/java)home too non using something similar /System/Library/Frameworks/JavaVM.frameworks/Version/1.6.0_22/Home, which is dependent plain to modify from loose to release. In lodge to laid upwards PATH merely add together this JAVA_HOME/bin into PATH.

These steps piece of work inwards OS X version Lion, Mountain Lion, Mavericks, Yosemite, too fifty-fifty inwards beta version of latest Mac version OS X El Capitan. Don't forget to laid upwards JAVA_HOME using selection -v if yous conduct maintain multiple Java version installed inwards your Macbook. You tin also run across human java_home for farther details. Let us know if yous facial expression upwards whatever work piece using Java inwards Apple's Macbook Pro too we'll travail to help.

Further Reading

No comments:

Post a Comment