Skip to content
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

Fixes for AsTeRICS running with Java 11 #323

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

deinhofer
Copy link
Contributor

This PR provides a runnable version of Asterics with Java 11 (tested with Linux and Win10, Oracle JDK 11).

Here are some useful infos about important changes between Java 8 and Java 11

Conclusion

  • The version is running but on Windows Serial over Bluetooth devices are not supported any more (e.g. HidActuator, or LipMouse with Bluetoothdevice?)
  • There might be some other uncovered easter eggs due to the removal of APIs or the restriction of access to com.sun or sun.misc. But the main models worked so far.

Due to the modularization of Java since Java 9, and the removal of some APIs and other changes, there had to be done the following fixes:

Upgrade of Eclipse Equinox OSGI engine to version 3.14

The upgrade was necessary due to a missing constraint java.net.ssl error when starting the grizzly-*-2.3.23.jar service.

The new version was modularized even more, e.g. the osgi console is not included by default. We could later think to remove it again, by removing ../bin/ARE/org.eclipse.equinox.console_1.3.300.v20190516-1504.jar and its dependencies

As of JDK 11 many APIs (e.g. javax.xml, javax.activation, javax.servlet,...) were removed from the core,
that's why we need to add them manually.
Some of them are added in another commit for the WebService service.

The following links were very helpful in finding the solutions and appropriate replacement jars:

Manually added JAXB dependency for webservice service as Java 11 does not ship it any more

Links helping to find the solution:

Fixed crash of rxtx library (cimcommunication) with Java 11 on Windows

The upgrade was necessary due to a missing constraint java.net.ssl error when starting the grizzly-*-2.3.23.jar service.
The new version was modularized even more, e.g. the osgi console is not included by default. We could later think to remove it again, by removing
 * ../bin/ARE/org.eclipse.equinox.console_1.3.300.v20190516-1504.jar and its dependencies

As of JDK 11 many APIs (e.g. javax.xml, javax.activation, javax.servlet,...) were removed from the core, that's why we need to add them manually.
Some of them are added in another commit for the WebService service.

The following links were very helpful in finding the solutions and appropriate replacement jars:
 * https://docs.oracle.com/en/java/javase/11/migrate/index.html#JSMIG-GUID-C25E2B1D-6C24-4403-8540-CFEA875B994A
 * https://download.eclipse.org/equinox/
* Unfortunately had to change alle build.xml files because the name of the file is hardcoded.
* A more elegent solution would have been to centrally define a property in imported.xml which is used in each build file, but unfortunately the import of the files is at the end of the build.xml files and hence other property values need for the file path definition would not have been set at that time of evaluation.
* APE: Here we had to fix the bin/APE/template/imported.xml file also to fix the name of the osgi-jar file to use when running an AT-solution
* ARE_RestAPIlibraries/JavaLibrary: Here we also had to include the jaxb-replacement jars into the classpath. I also deleted the jar files of JavaLibrary/lib and used the ones of ARE/services/WebService instead to avoid having duplicate jar files in the repository.
* This fix uses the java11 branch (https://github.com/NeuronRobotics/nrjavaserial/tree/java11) of the nrjavaserial project, which fixed the segmentation fault when using Java 11 on windows.
* Unfortunately, I could not apply the patch (NeuronRobotics/nrjavaserial@a190730) with get_long_var to the asterics-specific rxtx-version (https://github.com/asterics/AsTeRICS/tree/master/ARE/RXTX) for windows because that version does not have such a function but has other fixes which provide support for Serial devices over Bluetooth which is used e.g. for the HidActuator device.
  * Ideas for fixing the problem
    * skip support for serial over bluetooth
    * switch to JSSC: https://github.com/scream3r/java-simple-serial-connector
    * try to debug the lib and fix it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant