Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Executable Jar File

 
deepak kukreja
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Firat of all I want to ask what is the use of
making executable jar files.
Suppose 'm having two simple class files A.class and B.class
in E:\Files. I created one jar file with both of them.
I know that i have to update the Manifest file. I want to
ask what is to be written in that file for this particular case.
One more thing as these are simple class files, with no GUI,
even if I click on jar file>>>nothingwill happen >>i quess so.
Suppose I want to make an executable jar file say For
HelloWorld applet. Then which files i have to add into manifest file.
In jar file i will be having one class file for applet and one html file.
 
juliane gross
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't (yet) know much about how to build jar-files , but I know that rather than clicking on it to call, you should call it by entering this into the command line:
java -jar YourJarProgram.jar

as far as I know this goes for both OS: Windows (on the DOS-Prompt) and Linux.
[ June 21, 2003: Message edited by: juliane gross ]
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might want to take a look at the executable JAR file tutorial thread, found through a quick search on this forum. (The search page link is at the top right of this page.)
If the OS environment is properly configured and the JAR file is made correctly, it should be executable with a simple double-click.
One more thing as these are simple class files, with no GUI,
even if I click on jar file>>>nothingwill happen >>i quess so.

If the program simply displays text to the console, then you're right, double-clicking on the executable JAR may result in not much happening. With Windows, the OS is configured to run the JAR with javaw.exe, which runs a Java program much like java.exe does, except the console isn't displayed.
Suppose I want to make an executable jar file say For HelloWorld applet.
You cannot easily make an executable Applet, per se. You could write a Java program that could view a web page (i.e. a web browser) and is configured to open the page with the Applet you have. Or you could use the Applet as a Panel, and just add it to a Frame.
 
deepak kukreja
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Dirk
I got it working from console.
but there is one problem. When i double click on
jar file, wiz-zip opens.
How should i prevent it from win-zip.
Deepak
 
deepak kukreja
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Dirk
I got it working from console.
but there is one problem. When i double click on
jar file, wiz-zip opens.
How should i prevent it from win-zip.
Deepak
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic