I've started developing Java applications with NetBeans some days ago and I've created an applet that makes some stuff about linear equations and disequations. That applet is also stored on my server and I load it into a webpage using the <applet /> tag. When I double click the *.jar (generated from NetBeans when I load the project) file on my computer, nothing happens. I know this is a stupid question, I've also read a lot of articles about this question but I didn't solve my problem. What could I do if I want execute that jar file from my computer?
- You may have to make it a runnable jar. cafeaulait.org/course/week4/50.htmlRussell– Russell2013-06-09 09:32:58 +00:00Commented Jun 9, 2013 at 9:32
- 1I'll do that via command line, but I only need the jar file (generated from NetBeans) and the manifest.mf file?Alberto Miola– Alberto Miola2013-06-09 09:35:09 +00:00Commented Jun 9, 2013 at 9:35
- 1I think so, you'll have to write the manifest though. Alternatively the IDE may be able to help you: netbeans.org/kb/articles/javase-deploy.html#Exercise_1Russell– Russell2013-06-09 09:37:30 +00:00Commented Jun 9, 2013 at 9:37
- 1use eclipse instead of netbeans. create a project and stick all of your .java files in it. Once you have a nice project, export it as a runnable jar file. You can read up on netbeans vs eclipse, but I find eclipse faster and easier to use with javaTucker– Tucker2013-06-09 09:48:52 +00:00Commented Jun 9, 2013 at 9:48
- 1@DK64, With Eclipse you can export as a Runnable Jar. While I do not want to start a war, I have to agree with Tucker.Russell– Russell2013-06-09 10:01:37 +00:00Commented Jun 9, 2013 at 10:01
| Show 4 more comments
1 Answer
What could I do if I want execute that jar file from my computer?
The easiest way to achieve that is to launch the existing applet free floating using Java Web Start. JWS Can install desktop shortcuts or menu items to launch the app.
Re. suggestions that you have to make it a runnable Jar. That will work if the app. normally is a JFrame or Frame, but it won't work for an applet unless the applet has been written as an hybrid application/applet (and since you did not do that deliberately, no it wasn't).