I am new to ubuntu software installation "by hand". I want to install launch4j. I have followed the guide from StackExchange and other websites online.
Whatever I try, with or without sudo, using chmod for execute rights, I get this issue:
❮ onyr ★ kenzae❯ ❮ Downloads❯❯ sudo tar xf launch4j-3.12-linux.tgz -C /opt
❮ onyr ★ kenzae❯ ❮ ~❯❯ cd /opt/launch4j/
❮ onyr ★ kenzae❯ ❮ launch4j❯❯ ll
total 288
-rwxr-xr-x 1 root root 160 mai 17 2018 launch4j*
-rwx---r-x 1 root root 199603 mai 17 2018 launch4j.jar*
[...]
❮ onyr ★ kenzae❯ ❮ launch4j❯❯ sudo ./launch4j
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields (file:/opt/launch4j/lib/xstream.jar) to field java.util.Properties.defaults
WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.core.util.Fields
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/java/swing/plaf/windows/WindowsLookAndFeel
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:821)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:719)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:642)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:600)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at net.sf.launch4j.Main.main(Main.java:59)
Caused by: java.lang.ClassNotFoundException: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 10 more
I'm using java 13:
❮ onyr ★ kenzae❯ ❮ launch4j❯❯ java --version
java 13.0.2 2020-01-14
Java(TM) SE Runtime Environment (build 13.0.2+8)
Java HotSpot(TM) 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)
I'm running out of ideas. What should I do ? Thank and take care,
Onyr
EDIT
As proposed, I tried to use JDK 8 using the following commands
sudo apt-get install openjdk-8-jre
sudo update-java-alternatives --set java-1.8.0-openjdk-amd64
However, I still get the same error...
❮ onyr ★ kenzae❯ ❮ ~❯❯ java -version
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08)
OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)
❮ onyr ★ kenzae❯ ❮ usr❯❯ cd /opt/launch4j/
❮ onyr ★ kenzae❯ ❮ launch4j❯❯ ./launch4j
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields (file:/opt/launch4j/lib/xstream.jar) to field java.util.Properties.defaults
WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.core.util.Fields
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/java/swing/plaf/windows/WindowsLookAndFeel
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:821)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:719)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:642)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:600)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at net.sf.launch4j.Main.main(Main.java:59)
Caused by: java.lang.ClassNotFoundException: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 10 more
More info about my Java installed, maybe the problem comes from there:
❮ onyr ★ kenzae❯ ❮ jvm❯❯ sudo update-java-alternatives --set java-1.8.0-openjdk-amd64
update-alternatives: error: no alternatives for jabswitch
update-alternatives: error: no alternatives for jaccessinspector
update-alternatives: error: no alternatives for jaccesswalker
update-alternatives: error: no alternatives for kinit
update-alternatives: error: no alternatives for klist
update-alternatives: error: no alternatives for ktab
update-alternatives: error: no alternatives for mozilla-javaplugin.so
update-java-alternatives: plugin alternative does not exist: /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/IcedTeaPlugin.so
❮ onyr ★ kenzae❯ ❮ jvm❯❯ pwd
/usr/lib/jvm
❮ onyr ★ kenzae❯ ❮ jvm❯❯ ll
total 40
drwxr-xr-x 5 root root 4096 févr. 29 18:36 ./
drwxr-xr-x 146 root root 12288 mars 28 13:39 ../
lrwxrwxrwx 1 root root 25 avril 8 2018 default-java -> java-1.11.0-openjdk-amd64/
lrwxrwxrwx 1 root root 21 oct. 7 2018 java-1.11.0-openjdk-amd64 -> java-11-openjdk-amd64/
-rw-r--r-- 1 root root 2044 janv. 15 16:14 .java-1.11.0-openjdk-amd64.jinfo
drwxr-xr-x 9 root root 4096 févr. 1 14:11 java-11-openjdk-amd64/
drwxr-xr-x 9 root root 4096 févr. 21 16:53 java-13-oracle/
-rw-r--r-- 1 root root 3667 févr. 21 16:53 .java-13-oracle.jinfo
lrwxrwxrwx 1 root root 20 janv. 18 00:41 java-1.8.0-openjdk-amd64 -> java-8-openjdk-amd64/
-rw-r--r-- 1 root root 2712 janv. 18 00:41 .java-1.8.0-openjdk-amd64.jinfo
drwxr-xr-x 7 root root 4096 févr. 29 18:36 java-8-openjdk-amd64/
You have to install OpenJDK 8 instead of Oracle Java 13 with the following commands:
and then
./launch4j
will show the window.