Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why am I getting an exception when running a JAR file from the command prompt?

Hi I have made a runnable JAR file useing export option on eclipse. However, when I go to run the file via command prompt i get the following

Exception in thread "main" java.lang.NoSuchMethodError
    at org.eclipse.jdt.internal.jarinjarloader.RsrcURLConnection.getInputStream(RsrcURLConnection.java:43)
    at java.net.URL.openStream(Unknown Source)
    at sun.misc.URLClassPath$Loader.getResource(Unknown Source)
    at sun.misc.URLClassPath.getResource(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:56)    

Does any one have any ideas as to what im doing wrong? pretty new to the whole creating runnable files etc.

like image 855
Podge Avatar asked Dec 06 '25 10:12

Podge


1 Answers

Your jar is compiled with a newer version of java than the computer you are running it on.

like image 151
Rob Wagner Avatar answered Dec 08 '25 01:12

Rob Wagner



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!