I have a JAVA (awt) Project to build a desktop base utility. When I try to run this from other machine with only JRE Installed this is giving an exception as
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logger
at DataProcessor.DataProcessor.App.<clinit>(App.java:73)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Unknown Source)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:56)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
at java.base/java.net.URLClassLoader.findClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
here I am not using a maven project, creating an executable JAR directly from eclipse. All though I see the JAR for log4J (log4j-1.2.17.jar) in the MANIFEST. But this is giving an exception when I try to run it from other machines. ( Other machines has only JRE not JDK) following command I am using to run JAR
C:\Users\<username>\Desktop\Utility\latest>"C:\Program Files\Java\jre1.8.0_161\bin\java.exe" -jar Utility.jar