Can I have two versions of the JDK on my computer?

I am trying to install IntelliJ IDEA JDK on version 1.8 (because this is the latest version). When I go to System/Library/Frameworks/JavaVM.framework

IntelliJ IDEA shows 1.6. When I type java -version

it shows 1.8. I found this command under "Search default JDK on OSX" https://www.java.com/en/download/help/version_manual.xml

I'm confused as to which JDK versions I have ... and where they are. Appreciate any help.

+3


source to share


3 answers


Yes, you can. You have JDK 1.6 and 1.8 installed on your computer. According to the Jetbrains website , all of their products require Apple JDK 1.6 to be installed to run on Mac.
 For IntelliJ IDEA to use JDK 1.8, you will need to edit the file /Applications/<Product>.app/Contents/Info.plist

and change the JVMVersion from 1.6 * to 1.8 *:



<key>JVMVersion</key>
<string>1.8*</string>

      

+1


source


For java to run, it usually removes any version of the JDK when you get an update. Second, if you want to check which version you are using, I would understand what you are using for programming and see which version you are compiling (netbeans or eclipse for example). If it says 1.8, this is what you are using and the same for 1.6. If this does become a very big problem, all you need to do is uninstall java and then install and fix it.



0


source


There may be many different Java versions on your system. In general, Java depends on environment variables and the PATH environment variable. Some programs and tools look for tool-specific environment variables to allow you to use a specific version of Java for that specific tool.

In the case of IntellJ, the link Eddie B posted in his comment explains how IntellJ determines which "install" Java should use.

0


source







All Articles