0

I was able to run GUI java programs runs on .jar extension file by building it. But I was unable to run a simple program out of net beans by building it! For Example I couldnt run this program below by building it as jar file!

class A{
 public static void main(String args[]){
  System.out.println("HELLO WORLD");
  }
}

How can i run this type of program from .jar extension???

1 Answers1

0

Open cmd in from the folder that jar file is located and type this..

java -jar <jar-file-name>.jar

Any jar file can be executed using this way.

When you double click, program run and exit in a moment.. That's why you can't see..

Ramesh-X
  • 4,853
  • 6
  • 46
  • 67