greatspn / SOURCES

Main repository of the GreatSPN framework
GNU General Public License v2.0
42 stars 13 forks source link

(WSL Ubuntu 20.04) "The J2SE Platform is not correctly set up." #21

Closed Arminius closed 3 years ago

Arminius commented 3 years ago

Hi, after having solved #20, I now get the following error while trying to build GreatSPN:

  [ANT]  JavaGUI/Editor/dist/Editor.jar

BUILD FAILED
greatspn/JavaGUI/Editor/nbproject/build-impl.xml:151: The J2SE Platform is not correctly set up.
 Your active platform is: JDK_11, but the corresponding property "platforms.JDK_11.home" is not found in the project's properties files.
 Either open the project in the IDE and setup the Platform with the same name or add it manually.
 For example like this:
     ant -Duser.properties.file=<path_to_property_file> jar (where you put the property "platforms.JDK_11.home" in a .properties file)
  or ant -Dplatforms.JDK_11.home=<path_to_JDK_home> jar (where no properties file is used)

Apparently, ant is trying to use JDK 11 despite the fact that I have JDK 8 installed and that I get the following:

$ java -version
openjdk version "1.8.0_282"
OpenJDK Runtime Environment (build 1.8.0_282-8u282-b08-0ubuntu1~20.04-b08)
OpenJDK 64-Bit Server VM (build 25.282-b08, mixed mode)

I'm not very familiar with ant, how do I get it to use JDK 8?

amparore commented 3 years ago

I am not entirely sure how to deal with this error. The problem is originated by the fact that the project is made with NetBeans, which is quite rigid about inserting in the ant file the exact required JDK version. In principle, the easiest way to overcome this build error is to install JDK 11. Alternatively, I can provide you a change to use JDK 15 instead of the 11. Since the Java code uses the java.awt.desktop package, which was introduced with jdk 9, I believe that the minimum JDK required is the v9.

Il giorno gio 18 feb 2021 alle ore 20:18 Arminius notifications@github.com ha scritto:

Hi, after having solved #20 https://github.com/greatspn/SOURCES/issues/20, I now get the following error while trying to build GreatSPN:

[ANT] JavaGUI/Editor/dist/Editor.jar

BUILD FAILED greatspn/JavaGUI/Editor/nbproject/build-impl.xml:151: The J2SE Platform is not correctly set up. Your active platform is: JDK_11, but the corresponding property "platforms.JDK_11.home" is not found in the project's properties files. Either open the project in the IDE and setup the Platform with the same name or add it manually. For example like this: ant -Duser.properties.file= jar (where you put the property "platforms.JDK_11.home" in a .properties file) or ant -Dplatforms.JDK_11.home= jar (where no properties file is used)

Apparently, ant is trying to use JDK 11 despite the fact that I have JDK 8 installed and that I get the following:

$ java -version openjdk version "1.8.0_282" OpenJDK Runtime Environment (build 1.8.0_282-8u282-b08-0ubuntu1~20.04-b08) OpenJDK 64-Bit Server VM (build 25.282-b08, mixed mode)

I'm not very familiar with ant, how do I get it to use JDK 8?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/greatspn/SOURCES/issues/21, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGLFJEUZPUDFL7ERWPVR2FDS7VRXZANCNFSM4X234UGQ .

Arminius commented 3 years ago

Trying again with JDK 11:

$ java -version
openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment (build 11.0.10+9-Ubuntu-0ubuntu1.20.04)
OpenJDK 64-Bit Server VM (build 11.0.10+9-Ubuntu-0ubuntu1.20.04, mixed mode, sharing)

I still get the same error:

BUILD FAILED
greatspn/JavaGUI/Editor/nbproject/build-impl.xml:151: The J2SE Platform is not correctly set up.
 Your active platform is: JDK_11, but the corresponding property "platforms.JDK_11.home" is not found in the project's properties files.
Arminius commented 3 years ago

As a side note, I specifically installed Java 8 because the README.md states that Java 1.8+ is required. If you believe that the requirement is actually Java 9 upwards, you should really update the README.md.

amparore commented 3 years ago

If it does not compile automatically even with jdk11, a possible fix is to go in the SOURCES/JavaGUI/Editor sub-directory, and type:

ant -Dplatforms.JDK_11.home=<path to java 11> jar

where <path to java 11> is the directory where jdk11 is (on my linux pc it is in /usr/lib/jvm/java-11-openjdk-11.0.9.11-9.fc32.x86_64, but in WSL it will probably be in a different location).

Il giorno gio 18 feb 2021 alle ore 20:30 Arminius notifications@github.com ha scritto:

As a side note, I specifically installed Java 8 because the README.md states that Java 1.8+ is required. If you believe that the requirement is actually Java 9 upwards, you should really update the README.md.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/greatspn/SOURCES/issues/21#issuecomment-781583072, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGLFJEVS5VUQTDDDGXV6P4TS7VTGJANCNFSM4X234UGQ .

Arminius commented 3 years ago

Alright, that way I'm no longer getting the JDK Platform error. However, I get a new error:

  [LAUNCH4J] Java GUI (Windows EXE)
Exception in thread "main" java.lang.NoClassDefFoundError: com/thoughtworks/xstream/io/HierarchicalStreamDriver
        at net.sf.launch4j.Main.main(Main.java:61)
Caused by: java.lang.ClassNotFoundException: com.thoughtworks.xstream.io.HierarchicalStreamDriver
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
        ... 1 more
make: *** [Makefile:1862: JavaGUI/DISTRIB/GreatSPN Editor.exe] Error 1

I've now also installed the package libxtream-java, but the error still appears.

amparore commented 3 years ago

We are very close, because this last step is not necessary and can be disabled (it compiles a distributable Windows version of a Java JAR, which may run as a Java application anyway) Could you please send me the output of these two commands?

uname -s uname -r

Il giorno gio 18 feb 2021 alle ore 20:59 Arminius notifications@github.com ha scritto:

Alright, that way I'm no longer getting the JDK Platform error. However, I get a new error:

[LAUNCH4J] Java GUI (Windows EXE) Exception in thread "main" java.lang.NoClassDefFoundError: com/thoughtworks/xstream/io/HierarchicalStreamDriver at net.sf.launch4j.Main.main(Main.java:61) Caused by: java.lang.ClassNotFoundException: com.thoughtworks.xstream.io.HierarchicalStreamDriver at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) ... 1 more make: *** [Makefile:1862: JavaGUI/DISTRIB/GreatSPN Editor.exe] Error 1

I've now also installed the package libxtream-java, but the error still appears.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/greatspn/SOURCES/issues/21#issuecomment-781599707, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGLFJEWTSSO6PJEFY3JGW43S7VWTBANCNFSM4X234UGQ .

amparore commented 3 years ago

if uname -r outputs: microsoft-standard could you please just git pull the repo and retry?

Il giorno gio 18 feb 2021 alle ore 21:24 Elvio Amparore < elvio.amparore@gmail.com> ha scritto:

We are very close, because this last step is not necessary and can be disabled (it compiles a distributable Windows version of a Java JAR, which may run as a Java application anyway) Could you please send me the output of these two commands?

uname -s uname -r

Il giorno gio 18 feb 2021 alle ore 20:59 Arminius < notifications@github.com> ha scritto:

Alright, that way I'm no longer getting the JDK Platform error. However, I get a new error:

[LAUNCH4J] Java GUI (Windows EXE) Exception in thread "main" java.lang.NoClassDefFoundError: com/thoughtworks/xstream/io/HierarchicalStreamDriver at net.sf.launch4j.Main.main(Main.java:61) Caused by: java.lang.ClassNotFoundException: com.thoughtworks.xstream.io.HierarchicalStreamDriver at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) ... 1 more make: *** [Makefile:1862: JavaGUI/DISTRIB/GreatSPN Editor.exe] Error 1

I've now also installed the package libxtream-java, but the error still appears.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/greatspn/SOURCES/issues/21#issuecomment-781599707, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGLFJEWTSSO6PJEFY3JGW43S7VWTBANCNFSM4X234UGQ .

Arminius commented 3 years ago
$ uname -s
Linux
$ uname -r
4.4.0-19041-Microsoft
Arminius commented 3 years ago

After pulling, make just says "Nothing to be done for 'all'". I suppose that is a way to fix this error.

amparore commented 3 years ago

yes. The removed step is not needed. Consider that I only tested the WSL system once, on WSL version 1, a few years ago. I suppose you are now using WSL-2. I am not sure if the system is still working properly. I suggest you to use native GUI, which can be found here: http://www.di.unito.it/~amparore/mc4cslta/editor.html and the command line tools from the WSL system. The solver path probably needs to be modified accordingly (from Edit > Options > Solvers > GreatSPN directory) to point to the WSL directory as seen in Windows.

Il giorno gio 18 feb 2021 alle ore 21:41 Arminius notifications@github.com ha scritto:

After pulling, make just says "Nothing to be done for 'all'". I suppose that is a way to fix this error.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/greatspn/SOURCES/issues/21#issuecomment-781621490, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGLFJET7SJ7QBUSFEOID33TS7V3QDANCNFSM4X234UGQ .

amparore commented 3 years ago

Dear Arminius, the Windows exe of GreatSPN should be fixed and working again. Moreover, I have checked the integration with WSL-2 using Ubuntu, and I have fixed some issues. Now it appears to be working. The WSL installation instructions are also updated on the github page.

Il giorno gio 18 feb 2021 alle ore 21:46 Elvio Amparore < elvio.amparore@gmail.com> ha scritto:

yes. The removed step is not needed. Consider that I only tested the WSL system once, on WSL version 1, a few years ago. I suppose you are now using WSL-2. I am not sure if the system is still working properly. I suggest you to use native GUI, which can be found here: http://www.di.unito.it/~amparore/mc4cslta/editor.html and the command line tools from the WSL system. The solver path probably needs to be modified accordingly (from Edit > Options > Solvers > GreatSPN directory) to point to the WSL directory as seen in Windows.

Il giorno gio 18 feb 2021 alle ore 21:41 Arminius < notifications@github.com> ha scritto:

After pulling, make just says "Nothing to be done for 'all'". I suppose that is a way to fix this error.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/greatspn/SOURCES/issues/21#issuecomment-781621490, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGLFJET7SJ7QBUSFEOID33TS7V3QDANCNFSM4X234UGQ .

amparore commented 3 years ago

I am closing this issue.