Building with JDK9 does not work fully

143 views
Skip to first unread message

ma...@makr.zone

unread,
Apr 14, 2018, 6:39:01 AM4/14/18
to OpenPnP
Hi

I'm not ususally a Java developer (more into C, C++), so please bear with me.

Just found out that compiling with jdk-9.0.4 does not work fully.

[ERROR] COMPILATION ERROR :
[ERROR] /C:/Users/Markus/git/openpnp/src/main/java/org/openpnp/machine/reference/signaler/SoundSignaler.java:[18,17] package sun.audio does not exist

Strangely I can still start the build. Must be some delayed class loading magic :).

Some Test errors too, however I can't reproduce them at the moment(?).

When I figured out to install jdk-1.8.0_162 and how to activate it in Eclipse (illogically under "Window"/"Preferences"), it warns:

/openpnp/src/main/java/org/openpnp/machine/reference/signaler/SoundSignaler.java:[18,17] sun.audio.AudioPlayer is internal proprietary API and may be removed in a future release

The errors go away, all tests pass.

Just wanted to point this out as the doc says "requires Java 8 or higher":
https://github.com/openpnp/openpnp/wiki/Developers-Guide#jdk-or-jre-8

Again thanks for all the great work!

-Mark

Friedrich Mäckle

unread,
Apr 14, 2018, 7:06:24 AM4/14/18
to OpenPnP
Hi,

I introduced that in the code.

More information on this can be found here: https://bugs.openjdk.java.net/browse/JDK-8050465

I guess we should remove that code and replace the sun.audio interface. I created an issue on Github:


Best, Friedrich

Cri S

unread,
Apr 14, 2018, 7:51:50 AM4/14/18
to ope...@googlegroups.com
Several things is not working on Java9. It compiles and just not works
because mostly
the reflexion interface have changed and as result, old code don't works.

Use java jdk8 for compiling.

2018-04-14 13:06 GMT+02:00, 'Friedrich Mäckle' via OpenPnP
<ope...@googlegroups.com>:
> --
> You received this message because you are subscribed to the Google Groups
> "OpenPnP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to openpnp+u...@googlegroups.com.
> To post to this group, send email to ope...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/openpnp/29fbb798-5f3c-4a8a-b5ff-d9c053277da2%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

ma...@makr.zone

unread,
Apr 21, 2018, 4:01:46 AM4/21/18
to OpenPnP
Just for others to know, a little follow up:

If you installed JDK9 (on Microsoft Windows) and want to go back to JDK8 without removing JDK9, setting the environment variable %JAVA_HOME% to the JDK 8 path will make sure that your OpenPNP is built using JDK8 but it will still be run unter JDK9!

You need to also change the %PATH% environment variable to point to %JAVA_HOME%\bin. There is normally a fixed path (a linked directory) set that still points to JDK9.

Running under JDK9 will create problems. For instance you can't start the Computer Vision Pipeline editor:
2018-04-14 10:08:50 SystemLogger ERROR: Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: javax/activation/ActivationDataFlavor
2018-04-14 10:08:50 SystemLogger ERROR:     at org.openpnp.vision.pipeline.ui.PipelinePanel.<init>(PipelinePanel.java:99)
2018-04-14 10:08:50 SystemLogger ERROR:     at org.openpnp.vision.pipeline.ui.CvPipelineEditor.<init>(CvPipelineEditor.java:152)
2018-04-14 10:08:50 SystemLogger ERROR:     at org.openpnp.machine.reference.feeder.wizards.ReferenceStripFeederConfigurationWizard.editPipeline(ReferenceStripFeederConfigurationWizard.java:898)


_Mark

Reply all
Reply to author
Forward
0 new messages