TransWikia.com

Java error when trying to run UBCG jar (java.lang.ClassNotFoundException)

Bioinformatics Asked by Maloki on August 22, 2021

I wanna install UBCG.JAR in ubuntu 18.04 but I cannot run the java File UBCG.JAR.
when I type the code java -jar UBCG.JAR an error message appears.

Exception in thread "main" java.lang.NoClassDefFoundError: org/json/simple/parser/ParseException
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:56)

Caused by: java.lang.ClassNotFoundException: org.json.simple.parser.ParseException
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
… 3 more

One Answer

I solved this problem but UBCG.JAR does not work with java 11 . It is necessary to install openjdk-8-jre and switch the default java.

Install openjdk-8-jre

$ sudo apt-cache policy openjdk-8-jre
$ sudo apt install openjdk-8-jre=1.8.0_292

Switch the default java

$ sudo update-alternatives --config java
*            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1081  

Checking the default java

    $ java -version

openjdk version "1.8.0_292" OpenJDK Runtime Environment (build 1.8.0_292-8u292-b10-0ubuntu1~18.04-b10) OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)

Run the UBGC.jar

$ java -jar UBCG.jar 
      ###############################
      #         UBCG ver. 3.0       #
      ###############################

Answered by Fabio on August 22, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP