I am having an issue with Apache's Buildr complaining about an invalid source release. Whenever I try and build my project I get the following error message;
javac: invalid source release: 1.7
Usage: javac <options> <source files>
use -help for a list of possible options
Buildr aborted!
RuntimeError : Failed to compile, see errors above
One would assume I don't have Java 7 installed on my system, but when I execute javac -version
I get javac 1.7.0-u10-b08
, which is the OpenJDK I just installed.
What is going on here? My first guess would be that Buildr is running the wrong version of Java but I have no idea how to fix or confirm that.
To give some background to this question, I am running Mac OS X version 8 (Mountain Lion) and have installed the OpenJDK from http://code.google.com/p/openjdk-osx-build/. I am using RVM to manage Ruby and installed Buildr using env JAVA_HOME=$JAVA_HOME gem install buildr
as recommend in the documentation. My JAVA_HOME is set to /Library/Java/JavaVirtualMachines/1.7.0u.jdk/Contents/Home
, which is where I installed the OpenJDK.
If anyone could help me here I would really appreciate it.
UPDATE: It really looks like Buildr is just not respecting my JAVA_HOME. I went in and unchecked the system version (version 6) of Java in the Java Preferences and now I get a different error,
JavaVM: requested Java version ((null)) not available. Using Java at "" instead.
JavaVM: Failed to load JVM: /bundle/Libraries/libserver.dylib
JavaVM FATAL: Failed to load the jvm library.
Buildr aborted!
RuntimeError : can't create Java VM