imulsion
imulsion

Reputation: 9040

How to run Java applications without using an IDE or the command prompt

This is more curiosity than a problem:

I was recently wondering if there was a way to run compiled Java applications without using the cmd or an IDE such as Eclipse. I use Eclipse, but it isn't very useful if you want to run the program independently. Can you save Java files in Windows Explorer so you can create a shortcut for them? If so, how? Is there some sort of special extension to the file? I've heard of .JAR files, but I'm not sure what they are. Can anyone tell me how to do it?

Upvotes: 1

Views: 5418

Answers (2)

SIVA
SIVA

Reputation: 11

create the jar file for java application using following syntax jar -cvf .jar . then use javaw.exe -jar

Upvotes: 0

Arne
Arne

Reputation: 2146

.JAR files are archives containing - amongst other things - your compiled classes and a manifest file. You may set the main entry point of your application in that manifest. See Setting an Application's Entry Point.

Normally if you double click a jar file in windows it will be opened by javaw.exe -jar <yourFile.jar>. javaw.exe will lookup the manifest and try start the main class defined there.

Upvotes: 1

Related Questions