Building Idea with Java 1.6 on OSX

I'm having trouble building Intellij Community using Java 1.6 from the command line. I've also tried using Intellij and recieved similar results. The reason I'm trying to build with 1.6 is so I can run my plugin run configuration with Java 1.6 set as the SDK. Otherwise it seems I can't run my plugin using Java 1.6 or with the Java 1.8 SDK set to internal java 1.6

I installed the Java SDK from here:

https://support.apple.com/kb/DL1572?locale=en_US

Before running the build script I run to set my JAVA_HOME:

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


Then from in the root of the project I run:

ant build


Then I get the following error:

Buildfile: /Users/charlie/git/intellij-community/build.xml init:     [mkdir] Created dir: /Users/charlie/git/intellij-community/out/tmp build:      [java] Buildfile: /Users/charlie/git/i®ntellij-community/build/gant.xml      [java]      [java] doGant:      [java] Starting gant script /Users/charlie/git/intellij-community/build/scripts/dist.gant      [java] 'home' is not defined. Defaulting to '/Users/charlie/git/intellij-community'      [java] 'out' is not defined. Defaulting to '/Users/charlie/git/intellij-community/out'      [java] default:      [java] compile:      [java] 'jdkHome' is not defined. Defaulting to '/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home'      [java]      [gant] INFO: was not able to detect NIO API      [java] Build log (info) will be written to /var/folders/wk/_t0lrv9n1c7c4v6fnjvsplhh0000gn/T/system/build-log/build.log      [java] Loaded project /Users/charlie/git/intellij-community: 234 modules, 77 libraries      [java] ##teamcity[progressMessage 'Cleaning up sandbox folder']      [java]    [delete] Deleting directory /Users/charlie/git/intellij-community/out      [java]     [mkdir] Created dir: /Users/charlie/git/intellij-community/out      [java]     [mkdir] Created dir: /Users/charlie/git/intellij-community/out/dist.win.ce      [java]     [mkdir] Created dir: /Users/charlie/git/intellij-community/out/dist.all.ce      [java]     [mkdir] Created dir: /Users/charlie/git/intellij-community/out/dist.unix.ce      [java]     [mkdir] Created dir: /Users/charlie/git/intellij-community/out/dist.mac.ce      [java]     [mkdir] Created dir: /Users/charlie/git/intellij-community/out/artifacts      [java]     [mkdir] Created dir: /Users/charlie/git/intellij-community/out/artifacts/core      [java]     [mkdir] Created dir: /Users/charlie/git/intellij-community/out/artifacts/jps      [java] ##teamcity[buildStatisticValue key='Cleaning output time, ms' value='125']      [java] Starting build; incremental: false, cache directory: /Users/charlie/git/intellij-community/.jps-build-data      [java] Build scope: all modules, production only      [java] ##teamcity[blockOpened name='Compilation']      [java] ##teamcity[blockOpened name='Resources for |'xslt-rt|' production']      [java] ##teamcity[blockClosed name='Resources for |'xslt-rt|' production']      [java] ##teamcity[blockOpened name='Module |'xslt-rt|' production']      [java]      [java] BUILD FAILED      [java] /Users/charlie/git/intellij-community/build/gant.xml:51: Compilation failed      [java]      [java] Total time: 4 seconds      [java] ##teamcity[compilationStarted compiler='java']      [java] ##teamcity[message text='Cannot find JDK |'1.6|' for module |'xslt-rt|'' status='ERROR']      [java] ##teamcity[compilationFinished compiler='java']      [java] ##teamcity[blockClosed name='Module |'xslt-rt|' production']      [java] ##teamcity[blockClosed name='Compilation'] BUILD FAILED /Users/charlie/git/intellij-community/build.xml:31: The following error occurred while executing this line: /Users/charlie/git/intellij-community/build.xml:18: Java returned: 1 Total time: 5 seconds

3 comments
Comment actions Permalink

It looks like you changed 'Module SDK' for 'xslt-rt' module from 'Project Default (IDEA jdk)' to '1.6'. If you revert changes in xslt-rt.iml it would
probably fix the problem.

--
Nikolay Chashnikov
JetBrains
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Or probably you changed 'Project SDK' in File | Project Structure | Project from 'IDEA jdk' to '1.6'.

--
Nikolay Chashnikov
JetBrains
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

This is the correct answer. Thanks for the help! Setting the IDEA jdk properly to a Java 1.6 JDK worked.

0

Please sign in to leave a comment.