-
-
Notifications
You must be signed in to change notification settings - Fork 7k
MacOS - compiles but won't run (error loading Java) #10936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm having the same issue. I notice if I run the official executable directly I get a different JVMRuntime string: Official Not sure if that's just an alias and it's actually the same runtime, but I installed java using brew as suggested in the wiki build guide.
|
I'm having the same issue, too. |
I'm having the same issue myself, anyone crack it yet? |
Bumped into this same issue (I think) ant build leads to an error message saying "Error loading Java." `start: macosx-start: looking at my Java -> user@computer build % java -version |
In case someone is having this issue, this is how I managed to solve it (sort of). I was able to track this error message "Error loading java" to the appbundler native stub (the native binary that starts de JVM): https://github.com/arduino/appbundler/blob/524abf5654e4b564cfe44019fcc048bee6f02b8c/appbundler/native/main.m#L332 I wrote a simple program to load the library and get that function address, and it worked, so the library was ok, the stub was the problem. To help me diagnose the problem, I cloned that repository and added a few more log messages to help me understand what was going on. But after I build it, and ran 'ant start', the Arduino IDE ran sucessfully. So I dont know exactly what was the issue, but it seems to me that the binary in the build process is having some issue loading that library. I had to make two changes on the build.xml (on the appbundler repository): This information may help. I had to change to the sdk version I have installed (11.3), but by the comment in the code, apparently this is not a good solution.... <!-- WARNING: Do NOT use SDK with version superior to 10.9 because side effects have been
reported in applications using OpenGL, in particular AWT based java apps crashing
when using multi-monitor setups. See https://github.com/arduino/Arduino/pull/10234 and
related issues for details. -->
<!--arg value="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk"/-->
<arg value="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk"/> and removed the code signature (just for the test) <exec executable="codesign" failonerror="false"> In the Arduino build\build.xml, I removed the target that uses the zip from the internet, and replaced with the jar that I built: <!--antcall target="unzip">
<param name="archive_file" value="${staging_folder}/appbundler-1.0ea-arduino9.jar.zip" />
<param name="archive_url" value="https://downloads.arduino.cc/appbundler-1.0ea-arduino9.jar.zip" />
<param name="final_folder" value="${staging_folder}/appbundler-1.0ea-arduino9" />
<param name="dest_folder" value="${staging_folder}/appbundler-1.0ea-arduino9" />
</antcall>
<taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask" classpath="${staging_folder}/appbundler-1.0ea-arduino9/appbundler-1.0ea-arduino9.jar"/-->
<taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask" classpath="/Users/daniel/appbundler/appbundler/bin/appbundler-1.0.1-arduino.jar"/> In case you need more details, let me know. |
Exactly the same issue. Trying to build Arduino IDE from source code based on this wiki: ant dist, and ant build were successful, but ant start resulted in "error loading java" |
I'm unsure how to resolve this. I've installed JDK8 per the instructions and I can get the thing to compile fine. The app launches but immediately shows an alert "Error loading Java" and quits.
I've checked and rechecked the paths in the output and everything looks fine. As I understand it, the thing bundles the runtime environment into itself so shouldn't be reliant on whatever version of Java the system runs, is that correct?
ant build produces no error.
ant run produces:
When I run the app directly from its container I get this:
./macosx/work/Arduino.app/Contents/MacOS/Arduino
Am I missing something obvious?
The text was updated successfully, but these errors were encountered: