tags:

views:

245

answers:

3
+1  Q: 

Run Jar in Console

Hey y'all..

So I'm a .Net developer. I know that you java devs are gonna die laughing at this one.

I am writing a java applicaiton that outputs strings via System.out and I just want to know how to run this application outside my IDE. I have an executable jar. What does one do to see this output in a console.

Thanks in advance..

-Nick

+3  A: 

Basically: java -jar app.jar

Sun's site has more info

Malaxeur
What about a deployment solution that just requires end users to double click on the file? Batch file?
Nick
Note that this solution requires that you set the main class entry point: http://java.sun.com/docs/books/tutorial/deployment/jar/appman.html
Joel
+1  A: 

If I understood what you want,
java -jar JarFile.jar
should work fine.

Carlos
+1  A: 

As others have suggested:

java -jar JarFIle.jar

Note this requires you to set the main class entry point

If you don't/cann't set Main-Class then you would do:

java -cp JarFile.jar package.Classname

Additionally if you associate jar file types with your JRE then double click should work too.

Joel