Posts

Showing posts from December, 2017

How to run NetBeans 8 if multiple java version (Java 8 and Java 9) is available on MacOS

Image
After installing Java 9 NetBeans stopped working properly and instead of setting up the default java version to java 8 it was using java 9. I have figured out a solution to run NetBeans with Java 8 and also having Java 9 on MacOS to test new features available in Java 9. My approach to switching between different versions of java (in .profile) : Install both Java versions (Java 8 and Java 9) and also install NetBeans. Add the below lines in .profile under your user directory. export JAVA_7_HOME=$(/usr/libexec/java_home -v1.7) # add this line if you have Java 7 installed export JAVA_8_HOME=$(/usr/libexec/java_home -v1.8) export JAVA_9_HOME=$(/usr/libexec/java_home -v9) #create alias to switch instantly with java versions alias java7='export JAVA_HOME=$JAVA_7_HOME' alias java8='export JAVA_HOME=$JAVA_8_HOME' alias java9='export JAVA_HOME=$JAVA_9_HOME' #set default java version export JAVA_HOME=$JAVA_8_HOME To run NetB