0
$\begingroup$

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

$ java -version
Openjdk version "11.0.7" 2020-04-14
$\endgroup$
2
  • $\begingroup$ Thank you very much the problem solved, it was about JDK version $\endgroup$
    – Maloki
    Nov 6, 2021 at 0:11
  • $\begingroup$ Could you please either accept an answer, or write up (and accept) your own solution to this problem? $\endgroup$
    – gringer
    Mar 21 at 21:28

2 Answers 2

0
$\begingroup$

You are probably using the wrong java version it should be 8

try "java -version"

$\endgroup$
0
0
$\begingroup$

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       #
      ###############################
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.