3

I'm trying to set the IntelliJ IDEA JDK to version 1.8 (because it's the latest). When I navigate to System/Library/Frameworks/JavaVM.framework IntelliJ IDEA shows 1.6. When I type java -version it shows 1.8. I found that command under "Finding default JDK on OSX" https://www.java.com/en/download/help/version_manual.xml

I'm confused what versions of the JDK I have... and where they are located. Appreciate any help.

EGHDK
  • 17,818
  • 45
  • 129
  • 204
  • [IntelliJ JDK Setup](https://intellij-support.jetbrains.com/entries/23455956-Selecting-the-JDK-version-the-IDE-will-run-under) This is 'not' a good question for stackoverflow... – Edward J Beckett Dec 23 '14 at 03:15
  • 3
    @EddieB - Why isn't it a good question for SO? Questions about "software tools commonly used by programmers" are [on-topic](http://stackoverflow.com/help/on-topic). – Ted Hopp Dec 23 '14 at 03:21
  • @TedHopp The topic is fine... the question is not however a [minimal, complete, verifiable example](http://stackoverflow.com/help/mcve) – Edward J Beckett Dec 23 '14 at 03:23
  • 1
    @EddieB - That section starts, _"When asking a question about a problem caused by your code..."_ But this isn't a question about a problem caused by OP's code; it's about how to use a programming tool (IntelliJ and/or the JDK), so that criterion does not apply. – Ted Hopp Dec 23 '14 at 03:30
  • what system are you running on, on linux, you can have as many as you like, it is all controlled by environment variables like JAVA_HOME and PATH for example – nPn Dec 23 '14 at 03:31
  • @TedHopp I disagree... However, he didn't even search this site as there's already answers for this question... http://stackoverflow.com/questions/21147720/multiple-java-installations-in-mac-os-x-mavericks – Edward J Beckett Dec 23 '14 at 03:45
  • @EddieB - Well, the question being a duplicate or not well researched are very different objections than this not being a good question for SO. (Also, I don't think that other question is a duplicate, since it involves Eclipse and not IntelliJ.) What part of my earlier comments do you disagree with? Do you think the other question is also not a good fit for SO? I suggest that you just excerpt the relevant info from the link in your first comment and post it as an answer. – Ted Hopp Dec 23 '14 at 03:52
  • @nPn - The question is tagged [tag:osx]. – Ted Hopp Dec 23 '14 at 03:55
  • @TedHopp I concede... it's definitely a duplicate though. BTW... Nice Hat :) – Edward J Beckett Dec 23 '14 at 04:00

3 Answers3

1

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

<key>JVMVersion</key>
<string>1.8*</string>
Lofty
  • 96
  • 3
0

To start off java will usually uninstall any version of the JDK when you get an update. Secondly if you want to check to see what version you are running I would go into what ever you are using to program and see what version you are compiling under (For example netbeans or eclipse). If it says 1.8 that is what you are running and same for 1.6. If this is really becoming a super big problem all you have to is uninstall java then re install and it should fix it.

Oak
  • 498
  • 1
  • 5
  • 19
0

You can have many different versions of Java 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 particular tool.

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

nPn
  • 16,254
  • 9
  • 35
  • 58