{"action":"created","issue":{"url":"https://api.github.com/repos/processing/processing-android/issues/158","labels_url":"https://api.github.com/repos/processing/processing-android/issues/158/labels{/name}","comments_url":"https://api.github.com/repos/processing/processing-android/issues/158/comments","events_url":"https://api.github.com/repos/processing/processing-android/issues/158/events","html_url":"https://github.com/processing/processing-android/issues/158","id":111585196,"number":158,"title":"Building from command line fails","user":{"login":"Loadus","id":12010047,"avatar_url":"https://avatars.githubusercontent.com/u/12010047?v=3","gravatar_id":"","url":"https://api.github.com/users/Loadus","html_url":"https://github.com/Loadus","followers_url":"https://api.github.com/users/Loadus/followers","following_url":"https://api.github.com/users/Loadus/following{/other_user}","gists_url":"https://api.github.com/users/Loadus/gists{/gist_id}","starred_url":"https://api.github.com/users/Loadus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Loadus/subscriptions","organizations_url":"https://api.github.com/users/Loadus/orgs","repos_url":"https://api.github.com/users/Loadus/repos","events_url":"https://api.github.com/users/Loadus/events{/privacy}","received_events_url":"https://api.github.com/users/Loadus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-15T10:08:04Z","updated_at":"2015-10-15T19:10:45Z","closed_at":null,"body":"I get an error about Java mode when I try to build from the command line. I use Sublime Text to build the .apk, and this might just be a configuration error on my end but posting this just in case. Note - this works with earlier versions (last one tested was 3.0a5, builds fine). I can almost fix this, but I'm not exactly sure on what's going on:\r\n\r\n\r\n```\r\n$ processing-android --sketch=\"/home/loadus/Dropbox/inkbrush/processing/3.0/InkBrush/InkBrush.pde\" --output=\"/home/loadus/Dropbox/inkbrush/processing/3.0/InkBrush/android/\" --target=debug --run --force\r\n\r\n\r\nAPPDIR=/home/loadus/development/processing\r\nDIR=/home/loadus/development/processing/java\r\nL=rt.jar\r\nLIB=/home/loadus/development/processing/java/lib/rt.jar\r\nL=tools.jar\r\nLIB=\r\nJDKCP=/home/loadus/development/processing/java/lib/rt.jar\r\nSUCCESS=0\r\nDIR=/usr/lib/jvm/java-8-oracle/jre/bin/../..\r\nL=rt.jar\r\nLIB=/usr/lib/jvm/java-8-oracle/jre/bin/../../jre/lib/rt.jar\r\nL=tools.jar\r\nLIB=/usr/lib/jvm/java-8-oracle/jre/bin/../../lib/tools.jar\r\nJDKCP=/usr/lib/jvm/java-8-oracle/jre/bin/../../jre/lib/rt.jar:/usr/lib/jvm/java-8-oracle/jre/bin/../../lib/tools.jar\r\nSUCCESS=1\r\nCLASSPATH=/usr/lib/jvm/java-8-oracle/jre/bin/../../jre/lib/rt.jar:/usr/lib/jvm/java-8-oracle/jre/bin/../../lib/tools.jar:/home/loadus/development/processing/lib/AndroidMode.jar:/home/loadus/development/processing/lib/ant-launcher.jar:/home/loadus/development/processing/lib/ant.jar:/home/loadus/development/processing/lib/jna.jar:/home/loadus/development/processing/lib/pde.jar:/home/loadus/development/processing/core/library/core.jar:/home/loadus/development/processing/core/library/gluegen-rt-natives-linux-amd64.jar:/home/loadus/development/processing/core/library/gluegen-rt-natives-linux-armv6hf.jar:/home/loadus/development/processing/core/library/gluegen-rt-natives-linux-i586.jar:/home/loadus/development/processing/core/library/gluegen-rt-natives-macosx-universal.jar:/home/loadus/development/processing/core/library/gluegen-rt-natives-windows-amd64.jar:/home/loadus/development/processing/core/library/gluegen-rt-natives-windows-i586.jar:/home/loadus/development/processing/core/library/gluegen-rt.jar:/home/loadus/development/processing/core/library/jogl-all-natives-linux-amd64.jar:/home/loadus/development/processing/core/library/jogl-all-natives-linux-armv6hf.jar:/home/loadus/development/processing/core/library/jogl-all-natives-linux-i586.jar:/home/loadus/development/processing/core/library/jogl-all-natives-macosx-universal.jar:/home/loadus/development/processing/core/library/jogl-all-natives-windows-amd64.jar:/home/loadus/development/processing/core/library/jogl-all-natives-windows-i586.jar:/home/loadus/development/processing/core/library/jogl-all.jar\r\nPATH=/usr/lib/jvm/java-8-oracle/jre/bin/../bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/etc/OpenCL/java_native:/home/loadus/development/processing\r\n\r\nError: A JNI error has occurred, please check your installation and try again\r\n\r\nException in thread \"main\" java.lang.NoClassDefFoundError: processing/mode/java/JavaMode\r\n\tat java.lang.ClassLoader.defineClass1(Native Method)\r\n\tat java.lang.ClassLoader.defineClass(ClassLoader.java:760)\r\n\tat java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)\r\n\tat java.net.URLClassLoader.defineClass(URLClassLoader.java:467)\r\n\tat java.net.URLClassLoader.access$100(URLClassLoader.java:73)\r\n\tat java.net.URLClassLoader$1.run(URLClassLoader.java:368)\r\n\tat java.net.URLClassLoader$1.run(URLClassLoader.java:362)\r\n\tat java.security.AccessController.doPrivileged(Native Method)\r\n\tat java.net.URLClassLoader.findClass(URLClassLoader.java:361)\r\n\tat java.lang.ClassLoader.loadClass(ClassLoader.java:424)\r\n\tat sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)\r\n\tat java.lang.ClassLoader.loadClass(ClassLoader.java:357)\r\n\tat java.lang.Class.getDeclaredMethods0(Native Method)\r\n\tat java.lang.Class.privateGetDeclaredMethods(Class.java:2701)\r\n\tat java.lang.Class.privateGetMethodRecursive(Class.java:3048)\r\n\tat java.lang.Class.getMethod0(Class.java:3018)\r\n\tat java.lang.Class.getMethod(Class.java:1784)\r\n\tat sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)\r\n\tat sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)\r\n\r\nCaused by: java.lang.ClassNotFoundException: processing.mode.java.JavaMode\r\n\r\n\tat java.net.URLClassLoader.findClass(URLClassLoader.java:381)\r\n\tat java.lang.ClassLoader.loadClass(ClassLoader.java:424)\r\n\tat sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)\r\n\tat java.lang.ClassLoader.loadClass(ClassLoader.java:357)\r\n\t... 19 more\r\n[Finished in 0.1s with exit code 1]\r\n[cmd: ['processing-android', '--sketch=/home/loadus/Dropbox/inkbrush/processing/3.0/InkBrush', '--output=/home/loadus/Dropbox/inkbrush/processing/3.0/InkBrush/android', '--target=debug', '--run', '--force']]\r\n[dir: /home/loadus/Dropbox/inkbrush/processing/3.0/InkBrush]\r\n[path: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/etc/OpenCL/java_native:/home/loadus/development/processing]\r\n```"},"comment":{"url":"https://api.github.com/repos/processing/processing-android/issues/comments/148491440","html_url":"https://github.com/processing/processing-android/issues/158#issuecomment-148491440","issue_url":"https://api.github.com/repos/processing/processing-android/issues/158","id":148491440,"user":{"login":"Loadus","id":12010047,"avatar_url":"https://avatars.githubusercontent.com/u/12010047?v=3","gravatar_id":"","url":"https://api.github.com/users/Loadus","html_url":"https://github.com/Loadus","followers_url":"https://api.github.com/users/Loadus/followers","following_url":"https://api.github.com/users/Loadus/following{/other_user}","gists_url":"https://api.github.com/users/Loadus/gists{/gist_id}","starred_url":"https://api.github.com/users/Loadus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Loadus/subscriptions","organizations_url":"https://api.github.com/users/Loadus/orgs","repos_url":"https://api.github.com/users/Loadus/repos","events_url":"https://api.github.com/users/Loadus/events{/privacy}","received_events_url":"https://api.github.com/users/Loadus/received_events","type":"User","site_admin":false},"created_at":"2015-10-15T19:10:45Z","updated_at":"2015-10-15T19:10:45Z","body":"Almost got it to build, the compile exited with two errors:\r\n```\r\n12. ERROR in /tmp/android843914374061291639sketch/src/processing/test/inkbrush/MainActivity.java (at line 26)\r\n\tFragmentTransaction ft = getFragmentManager().beginTransaction();\r\n\t                         ^^^^^^^^^^^^^^^^^^\r\nThe method getFragmentManager() is undefined for the type MainActivity\r\n----------\r\n13. ERROR in /tmp/android843914374061291639sketch/src/processing/test/inkbrush/MainActivity.java (at line 29)\r\n\tfragment = (PApplet) getFragmentManager().findFragmentByTag(MAIN_FRAGMENT_TAG);\r\n\t                     ^^^^^^^^^^^^^^^^^^\r\nThe method getFragmentManager() is undefined for the type MainActivity\r\n```\r\n\r\nI had to add direct paths to various libs in processing-android (mainly because I don't know how to ask for Processing to provide the paths):\r\n```\r\nfor LIB in \"$APPDIR\"/modes/java/mode/*.jar; do\r\n  CLASSPATH=\"$CLASSPATH\"${CLASSPATH:+:}\"$LIB\"\r\ndone\r\n\r\n  CLASSPATH=\"$CLASSPATH\"${CLASSPATH:+:}\"/home/loadus/sk3tchbook/modes/AndroidMode/mode/AndroidMode.jar\"\r\n  CLASSPATH=\"$CLASSPATH\"${CLASSPATH:+:}\"/home/loadus/sk3tchbook/modes/AndroidMode/android-code.zip\"\r\n  CLASSPATH=\"$CLASSPATH\"${CLASSPATH:+:}\"/home/loadus/development/android-sdk-linux/platforms/android-17/android.jar\"\r\n\r\n```\r\n\r\nand I had to copy android-core.zip to /modes/android in Processing's folder. \r\n\r\nAnd let me know if this is an issue no one cares about so I'll know when to stop. I'd really love to get this working as I do my coding on external editors.\r\n\r\n"}}