I hope no-one has asked this before (I couldn’t find anything, but that may just be poor searching). I am compiling by running ant in my root directory. However, I get this error:
class file has wrong version 50.0, should be 49.0
I know this is because it wants Java 1.6, and is using 1.5, but my mac has Java 1.6 as well (I’ve checked in /System/Library/Frameworks/JavaVM.framework/Versions). How can I get ant to run with 1.6 so that I can compile?
EDIT:
I’ve added the correct path of Java 1.6 to /etc/profile, and
export PATH=$JAVA_HOME/bin:$PATH, after this line. Executing java -version gives the correct version (1.6.0), but running ant -v still produces the same error, and states that Java 1.5 is being used.
Does anyone know how I can force ant to use Java 1.6?!
One easy way is to set
JAVA_HOMEenvironment variable to point to the jdk you want to use.There’re many ways to do that. E.g., if you’re on mac/linux, you could add this to
/etc/profileOn windows, IIRC, there’s a menu in My Computer/properties.