Open morungos opened 3 years ago
Thanks so much for your report and excellent analysis of the problem @morungos! If I understand correctly, this is the same as https://github.com/arduino/Arduino/issues/10964. Is that correct?
Great question, I'd somehow managed to miss that one. They're certainly very closely related, and yes: I think this is probably a duplicate of that. Certainly, I can use the IDE on Big Sur -- so long as I removed installed Oracle Java directories. I also have an OpenJDK/adoptopenjdk version in /Library/Java/JavaVirtualMachines
and that doesn't seem to cause the problem. And I see that in #10964, the IDE is similarly modifying the JVM path to a non-app Java (in that case: jdk1.8.0_181.jdk
), so the common theme of the JVM Runtime path updated to
log line does seem to be implicated.
I do have a feeling that, like in the comment by DrSAR, I once got accidentally get through the crash to a working state, even before and on Big Sur. Similarly I have vague memories of something not dissimilar happening in Catalina. In any event, it does seem to be the search for (and acceptance of) an unrelated Java 8 virtual machine from the system that triggers the havoc, but I'd be slightly surprised if this was specific to Big Sur.
There are reports of Java changes in Big Sur (see: https://stackoverflow.com/questions/64917779/wrong-java-home-after-upgrade-to-macos-big-sur-v11-0-1/64917842) but there's no evidence that java_home
/JAVA_HOME
is ever used. That does break Java IDEs like Eclipse, but... my $JAVA_HOME
is now empty, and yet the Arduino IDE is working, and /usr/libexec/java_home
does find my OpenJDK one.
I did a little digging and the prime suspect seems to me to be Appbundler. Some of the log statements match old open source forks, but not all. So I'm wondering whether it's being either too smart or too stupid to correctly handle the Mac case of a specific, provided, bundled JRE -- and this might explain why Big Sur does seem to be more exposed. But my Java skills are a little rusty.
I'm not sure which of these duplicate issues are definitive, but this has a descriptive title so I'll comment here.
There are a few steps that should be taken to fix this:
When attempting to start the IDE on a Mac with Java installed, it crashes out after showing the splash screen. It's not entirely predictable, because I've been using the IDE with reasonable success until a week or so ago. However, there is enough that this seems to be a bug. It appears to be searching for Java versions and accidentally finding the browser plugin one rather than an actual functioning Java. Erasing Oracle Java from the system (as per: https://stackoverflow.com/questions/19039752/removing-java-8-jdk-from-mac) does resolve the problem, and the IDE then starts successfully.
OS: Macos 11.0.1 Arduino IDE: 1.8.13 Oracle Java versions installed: jdk1.8.0_111 and jdk1.7.0_80.jdk (Note: switching off browser plugins did not solve the problem).
The problem shows up in the command line when starting the IDE directly. With Oracle Java installed, key lines:
There is more, but it's verbose and doesn't seem particularly relevant. However, the
JVM Runtime path updated to: /Library/Internet Plug-Ins/JavaAppletPlugin.plugin
does seem to be a useful sign of an erroneous startup step.The startup then fails with:
I doubt if the more detailed log is useful, but I'll add if requested. However, one line does jump out -- showing a mixup between
java.ext.dirs
andjava.library.path
that looks like a harbinger of doom.After removing Oracle Java (I do still have an OpenJDK install):
Despite these log lines, the IDE seems to start and run fine.
This seems to be fairly easy to work around by simply removing Oracle Java entirely (unless you really need Oracle Java, and let's be honest, who does?) but the user experience is not especially helpful (a vanilla crash) so it would be great if the IDE could avoid this issue in future.
Note that there is some similarity to #9828, and there are mentions of issues relating to the Java bundled inside Arduino on the in the forums, but this seems to be a distinct issue, as origins seem to be more in Oracle Java and its Mac paths than anything else.