• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Executable Jar File

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
All of the following truths are shameless lies. But what about this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic