prismmodelchecker / prism-ext

Publicly released extensions and snapshots of PRISM. The master branch mirrors the main repo; each extension/snapshot is in a separate branch/release.
GNU General Public License v2.0
2 stars 0 forks source link

Prism-POMDP fails to compile on MacOS/OpenJDK 14 #1

Open sjunges opened 4 years ago

sjunges commented 4 years ago

Hi all,

I was trying to compile prism, and got the following error upon running make:

Making src/userinterface ... (cd ..; javac -encoding UTF8 -sourcepath userinterface/../../src -classpath "userinterface/../../classes:userinterface/../../lib/" -h userinterface/../../include/jni -d userinterface/../../classes userinterface/CheckBoxList.java) Note: userinterface/CheckBoxList.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. (cd ..; javac -encoding UTF8 -sourcepath userinterface/../../src -classpath "userinterface/../../classes:userinterface/../../lib/" -h userinterface/../../include/jni -d userinterface/../../classes userinterface/GUIClipboard.java) userinterface/../../src/userinterface/properties/GUIExperiment.java:370: error: invalid use of a restricted identifier 'yield' yield(); ^ (to invoke a method called yield, qualify the yield with a receiver or type name) userinterface/../../src/userinterface/properties/GUIExperiment.java:375: error: invalid use of a restricted identifier 'yield' yield(); ^ (to invoke a method called yield, qualify the yield with a receiver or type name) Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

I run a Mac 10.14.6 with:

I openjdk 14.0.1 2020-04-14 OpenJDK Runtime Environment (build 14.0.1+7) OpenJDK 64-Bit Server VM (build 14.0.1+7, mixed mode, sharing)

Additinional question: Given that the bug seems to be in the gui, can I compile just the command line interface?

davexparker commented 4 years ago

Hi. This is due to the use of Java 14. It's fixed in the main repo. Just 2 lines need changing:

https://github.com/prismmodelchecker/prism/commit/129c22e229ce11e362e7764f7e726cec36aa3b25

I plan to push a new version of PRISM-pomdps soon, rebased against the latest version of PRISM and with various other fixes, but applying the above commit is the simplest short-term fix.