0
votes

I am using unity3d version 4.5.4 on mac osx I downloaded and installed the latest ADT on mac osx I aslo downloaded and install the java 8

now hen i build my project for android I get the following error

Failed to compile resources with the following parameters: -bootclasspath "/Users/Apple/Documents/Android_SDK/adt-bundle-mac-x86_64-20140702/sdk/platforms/android-22/android.jar" -d "/Users/Apple/Desktop/Sachet_d/Sachet_Data_16/android_wobbly_iPhone/Temp/StagingArea/bin/classes" -source 1.6 -target 1.6 -encoding UTF-8 "com/facebook/android/R.java" "com/jelly/wobble/R.java" warning: java/lang/Object.class(java/lang:Object.class): major version 51 is newer than 50, the highest major version supported by this compiler.

I am a java expert and this error is caused because unity is compiling the .java to target 1.6 but it refers to a Library (android.jar - part of the ADT) whose target was 1.7. I am certian if I can change the compiler option in unity3d from - target 1.6 to -target 1.7 the error will go away

1
"I am certian if I can change the compiler option in unity3d from - target 1.6 to -target 1.7 the error will go away" so what seems to be the problem then? - Max Yankov

1 Answers

0
votes

Issue could probably that there has already being a JDK version. As you have already installed JDK 8, Use a link to the latest JDK as what you wish to use.

sudo ln -nsf /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/ \
/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK