Android java issue

edited March 2014 in Android Mode

So I am on Mac osx 10.9 using processing 2.1.1 trying to compile with my nexus 7 android 4.4.2 I tried following the steps on wiki and forum, but no help! When I run a simple sketch. Giving me error.. Any help appreciated.

API<=15: Adding annotations.jar to the classpath. [echo] ---------- [echo] Building Libraries with 'debug'... [subant] No sub-builds to iterate on

-code-gen: Merging AndroidManifest files into one. Manifest merger disabled. Using project manifest only. [echo] Handling aidl files... No AIDL files to compile. [echo] ---------- [echo] Handling RenderScript files... [echo] ---------- [echo] Handling Resources... Generating resource IDs... [echo] ---------- [echo] Handling BuildConfig class... Generating BuildConfig class.

-pre-compile:

-compile: [javac] Compiling 3 source files to /var/folders/g1/4_6qvpkd7871k5hrggy4dbcr0000gn/T/android5928852609214156914sketch/bin/classes [javac] Unable to locate an executable at "/Applications/Processing.app/Contents/PlugIns/jdk1.7.0_51.jdk/Contents/Home/jre/bin/javac" (-1)

BUILD FAILED /Users/mudy/adt-bundle-mac-x86_64-20131030/sdk/tools/ant/build.xml:720: The following error occurred while executing this line: /Users/mudy/adt-bundle-mac-x86_64-20131030/sdk/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.

Total time: 1 second

Answers

  • This seems to be a common issue. There are two options that you have that seem to work for most people: downgrade the ADT from 19 to 18, or downgrade Processing from 2.1.1 to 2.0.3.

    Some related questions:

    http://forum.processing.org/two/discussion/750/error-from-inside-the-android-tools-check-the-console-with-processing-2-1/p1

    http://forum.processing.org/two/discussion/982/error-from-inside-the-android-tools/p1

  • Answer ✓

    SOLVED for Mac OS X running 10.7.5 Running Processing 2.1.2 Android SDK Manager - Android SDK Build-tools 19.0.3 You may or may not need to upgrade to Java JDK 1.8.0_05. I did. 1) Goto /Applications/Processing.app/Contents/Plugins/jdk1.7.0_51.jdk/Contents 2) As a precaution: Rename directory Home to Home_old; rename Info.plist to Info_old.plist; rename MacOS to MacOS_old 3) Copy everything in /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents into /Applications/Processing.app/Contents/Plugins/jdk1.7.0_51.jdk/Contents

    Restart Processing and rebuild. The emulator will start and your sketch will run.

  • Thank you Listersen, that worked perfectly for me :)

  • edited September 2014

    My /Library/Java/JavaVirtualMachines/ is empty. And /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents is different from the list above.

    Any help would be nice, thanks!

  • Thanks to Listersen!

    I didn't have to upgrade to Java JDK 1.8. I'm using jdk1.7.0_71.jdk, with Processing 2.2.1 (on MacOS 10.8). I followed Listersen's instructions, copied everything from my regular Java installation in /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents to /Applications/Processing.app/Contents/PlugIns/jdk1.7.0_55.jdk/Contents, and everything works now.

    Maybe the problem is Processing's Java plugin is a different version from my default Java installation? I also spent many hours tinkering with PATHs, but nothing worked.

    I also tried editing Processing's preferences.txt. But the weird thing is, references.txt would revert back to the old version once I start Processing. Is Processing regenerating the preferences.txt file dynamically?

    By the way, I have Android Studio and the adt bundle working pretty smoothly, so I don't think the issues are with my Android installation.

    Bill

Sign In or Register to comment.