• 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
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

How to create executable jar file?

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anybody tell me How to create executable jar file?
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Packaging Programs in JAR Files
 
Vipul Gulhane
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Darryl Burke wrote:Packaging Programs in JAR Files


sir thanks for reply but i want to create executable jar file.
which is executable if the uesr dubble click on it.........
 
Rancher
Posts: 43081
77
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
... which is what is described there.
 
Vipul Gulhane
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:... which is what is described there.



sir thanks for reply but i want to create executable jar file.
That jar file is executable if the uesr dubble click on it.........
 
Ranch Hand
Posts: 85
Mac Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In Ubuntu you have to make the Jar executable in order for it to be launched. Right click, permissions, enable execution. Hope that helps.
 
Vipul Gulhane
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Cory Hartford wrote:In Ubuntu you have to make the Jar executable in order for it to be launched. Right click, permissions, enable execution. Hope that helps.


And in XP /win7 what we have to do?
 
Cory Hartford
Ranch Hand
Posts: 85
Mac Eclipse IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You shouldn't have to do anything aside from double click. You have to make sure you have the Java runtime environment installed. Also verify that the the files extension is for sure a JAR. If you followed the directions in the above link it should walk you through the process.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
have you followed the instructions here: http://download.oracle.com/javase/tutorial/deployment/jar/run.html (from the above link) - specifically adding the main class definition in the manifest?

After that, the jar can be executed using the following command:

java -jar jar-file-name


some OS will handle this on double click so you dont have to type this every time, but this is not guaranteed on every OS..

The other option is to create a bat/sh file that can be double clicked to launch the jar.
 
Vipul Gulhane
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how to create a runnable JAR file of our 'Java Application'.
in eclipse select project->export->java->then select runnable JAR
will this create 'Java Application runnable JAR file...
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm at a loss to understand what you're looking for. Darryl pointed you to a writeup that contains the answer you're looking for. You seem to have overlooked that, so I pointed out that, yes, indeed, the answer is in there. I thought for sure you would now read it more carefully. Instead, you're repeating essentially the same question a third time; may be you can apply yourself a bit harder?

As to the Eclipse part: what happened when you tried?
 
Tick check! Okay, I guess that was just an itch. Oh wait! Just a tiny ad:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic