icyphy / ptII

Ptolemy II is an open-source software framework supporting experimentation with actor-oriented design.
https://ptolemy.eecs.berkeley.edu/ptolemyII
Other
99 stars 43 forks source link

JDK shipped with nightly build installers needs to be updated #335

Open cxbrooks opened 4 years ago

cxbrooks commented 4 years ago

The JDK shipped with the nightly build installers needs to be updated because the JDKs are based on JDK1.8 and the nightly build is compiled with JDK9 or later.

During installation under macOS, the problem first appears if a user attempts to start Vergil during the installation process. The error message is

LSOpenURLsWithRole() failed with error -10810 for the file /Applications/ptII11.1.devel/bin/Vergil.app

The workaround is to run:

cd /Applications/ptII11.1.devel
open ./bin/Vergil.app/Contents/MacOS/universalJavaApplicationStub

The long term solution is to update the JDK for Windows and Mac.

For macOS, the $PTII/bin/jdk directory is created by $PTII/bin/makeapp. makeapp is created by running configure, which reads $PTII/bin/ptinvoke.in, creates ptinvoke and then creates symbolic links for files such as makeapp. Under macOS, running (cd $PTII/bin; make) should create the jdk/ directory, but there are problems redistributing JDK10.

bash-3.2$ rm -rf Vergil.app/
bash-3.2$ make Vergil.app
./makeapp Vergil.app FULL -full
Updating universalJavaApplicationStub from /Users/cxh/src/ptII11.1.devel/vendors/universalJavaApplicationStub/src/universalJavaApplicationStub
./makeapp: /Library/Java/JavaVirtualMachines/jdk-12.0.1.jdk/Contents/Home/jre/COPYRIGHT does not exist, perhaps you are using Java 10?
The Java 10 JDK does not include a JRE that is easy to ship separately, so if you do 'export TRAVIS=true' and rerun,
then a Java 8 JVM will be downloaded.  You may need to remove Vergil.app before rerunning.
Untaring /Users/cxh/src/ptII11.1.devel/vendors/installer/MacJVM.tar.gz in /Users/cxh/src/ptII11.1.devel/ now: Wed Sep  4 09:08:01 PDT 2019
./makeapp: Installation of /Users/cxh/src/ptII11.1.devel/jdk succeeded.
./makeapp: copying /Users/cxh/src/ptII11.1.devel/vendors/jogl to /Users/cxh/src/ptII11.1.devel/bin
touch Vergil.app

Once an updated JDK is created, for the Travis installer to have the macOS jdk/ directory, https://ptolemy.berkeley.edu/ptolemyII/MacJVM.tar.gz should be updated.

For Windows, $PTII/adm/gen-11.1/jre64 should be updated.

I attempted to build Ptolemy II using a JDK12 javac by using the --release 8 flag, but compilation failed because JavaFX was not available. With JDK12, JavaFX is a module, and using --release 8 means that the module system is not available. JavaFX is used by the audio accessors, which are a big part of the new work in Ptolemy II 11, so releasing without the audio accessors is not a good idea.

cxbrooks commented 2 years ago

So one fix to this would be to ship the installers with OpenJDK included. However, OpenJDK seems to be GPL v2 with a classpath exception, see https://openjdk.java.net/legal/gplv2+ce.html

AdoptOpenJDK could be of use.