Jar file can run via Command Prompt, but not by double clicking?
-
I can execute my jar file fine by using this line in command prompt: java -jar jarFile.jar But whenever I double click the jarfile, it comes up and says it couldn't find the main class. I made a little batch file that will make it work through double clicking, but then command prompt appears, and the jar file looses it's Java icon.
-
Answer:
You need a manifest file inside of the jar that states the main-class. This tutorial tells you how to do so: http://docs.oracle.com/javase/tutorial/deployment/jar/appman.html --edit The first answer to this stack exchange question seems to work: http://stackoverflow.com/questions/5428079/could-not-find-the-main-class-when-double-clicking-jar-file
Austin at Yahoo! Answers Visit the source
Related Q & A:
- How To Run A Command In Ubuntu?Best solution by Yahoo! Answers
- How to upload .jar file in Wordpress?Best solution by WordPress
- How to create jar file with OpenCV in Eclipse?Best solution by Stack Overflow
- How can I run CMD command?Best solution by Super User
- Is it illegal to change your IP through the command prompt?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.