-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Upgrade to Java 11 #8193
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
Hi @salmanee , |
Thanks for your response @facchinm .. Thanks, |
So, to start easily you can try building the "light bundle" package which doesn't contain the JRE (and falls back using the system one). |
Thanks again for your response. I tried building Arduino using the "light bundle". Again the tool got built successfully but I still can't get it to run (It seems that its still looking for JREs as it states that it wasn't able to locate a Java Runtime Enviroment) |
To further explain what we did:
We are not sure how to proceed with this.. any help will be greatly appreciated! |
Thanks for the explanation! Does it run without |
It doesn't run with the executable. and bundling the full jvm didn't work out either. It might have to do with the fact that one of the jar files contain an API the was removed in jdk9 (JDK removed internal API/com.sun.image.codec.jpeg) and that's the reason why its not running but Im not sure why the compiler didn't complain about this. |
I think I figured out the issue.. The reason why it's not able to locate a java runtime environment is because com.apple.eawt is removed from jdk9+ and should be replaced with java.awt.desktop .. I can fix this issue by adding the following statement at compile time: my question is how can this statment be added at compile time for Arduino ? |
Arduino/app/src/processing/app/Base.java Line 143 in b7728be
|
Here is an example from Java 10: How to implement About, Preferences, and Quit menu items on MacOS by Alvin Alexander: import java.awt.*;
import javax.swing.*;
public class JavaAwtDesktop {
public static void main(String[] args) {
new JavaAwtDesktop();
}
public JavaAwtDesktop() {
Desktop desktop = Desktop.getDesktop();
desktop.setAboutHandler(e ->
JOptionPane.showMessageDialog(null, "About dialog")
);
desktop.setPreferencesHandler(e ->
JOptionPane.showMessageDialog(null, "Preferences dialog")
);
desktop.setQuitHandler((e,r) -> {
JOptionPane.showMessageDialog(null, "Quit dialog");
System.exit(0);
}
);
SwingUtilities.invokeLater(() -> {
JFrame frame = new JFrame("java.awt.Desktop");
frame.setSize(new Dimension(600, 400));
frame.setLocationRelativeTo(null);
frame.setVisible(true);
});
}
} |
Hey,
Did anyone manage to build and compile Arduino in JDK9+?
The text was updated successfully, but these errors were encountered: