Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 11661

Exception on double click jar file, but working fine on cmd [closed]

$
0
0

i´ve read posts of people having this problem, but i didn´t solve this problem. When i simply use a code like this...

package any;import JOptionPane;public class Main{      public static void main(String[] args){     JOptionPane.showMessageDialog(null,"Testing");}}

obviously, i have another code that is more sophisticated, but i was testing this simply code to confirm the problem root (i thought my code was the problem), but it didn´t work neither. For some reason, it worked fine with both codes (the sophisticated, and this simply one) in cmd using java -jar x.jar

thank you so much for your help!

So, i was trying to run in windows my jar file with double click, but i received an exception "A Java Exception Has Ocurred". But not happening in cmd. Something I could contribute is that, when I checked what I was running it with, it had javaw.exe, so I changed it to what some were recommending, which was java.exe, but with this, it only opens and closes


Viewing all articles
Browse latest Browse all 11661

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>