JAR File Runs From CMD But Not Via Double Clickin | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

JAR File Runs From CMD But Not Via Double Clickin

I made a simple java application and am trying to run it as a standalone JAR file via double clicking. It will not launch when clicked, only when using java -jar <path> in the cmd line. Please help! (I have JRE 9.0 installed. Have tried on Windows and OSX. Built using Intellij IDE). Thanks for the help in advance! EDIT: When running from cmd on Windows, I am provided the following information: at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$100(Unknown Source) at java.net.URLClassLoader$1.run(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 sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)

3rd Dec 2018, 7:00 PM
Bobby Binning
Bobby Binning - avatar
4 Answers
+ 9
Seniru Pasan , Same like Danijel Ivanović //I also have not much knowledge about making app by now
4th Dec 2018, 4:09 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 5
Seniru Pasan 👍 Thank you for mentioning me,😉 but I did not make an app, I'm sorry!
4th Dec 2018, 2:09 PM
Danijel Ivanović
Danijel Ivanović - avatar
+ 3
I had the same issue. So I m using a shortcut file that links to a batch script . You could try it too. But I also dont know how to do it properly. So I will call some people who could manage this. Danijel Ivanović Gaurav Agrawal
4th Dec 2018, 1:15 PM
Seniru
Seniru - avatar
+ 1
Then we have to call somebody who makes apps. BTW you can run jar files by just clicking as I have saw in videos. The case with me is I get an error(ClassNotFoundException) when I run by clicking. But batch/cmd does the task. Just curious to know how to run apps by just clicking.
4th Dec 2018, 4:13 PM
Seniru
Seniru - avatar