GeeCON Prague 2014*
The moose likes Java in General and the fly likes need help deploying executable jar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "need help deploying executable jar" Watch "need help deploying executable jar" New topic
Author

need help deploying executable jar

Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4347
    
    2

i have finally worked the bugs out of my latest project. i want to make it an executable jar. the problem is i have java 7 and many people don't(i use command line). i thought to use eclipse, it seems to let you compile using older compilers. it will also probably help make the jar. i can create a workspace and import the java files but that is as far as i get. it is driving me crazy


SCJP
Visit my download page
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39095
    
  23
I presume you have all the Java files ready on Eclipse or whichever IDE? Then you can r‑click the project name and click export as jar. There is an option on one of the windows to add an entry point (=class with main method). On Windows® you can double‑click the jar and it runs with javaw. You may have to set up a file association first. I am pretty sure there is an analogous operation on other OSs.
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4347
    
    2

two seperate problems. compile using older compiler. then make a jar. i couldn't find export as jar

i get as far as create a workspace
create a project
import files
that is as far as i can get
i can jar it from the command line but then only people with java7 can run it.
this eclipse program is way too complicated for me. it would take months to learn it
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4347
    
    2

hell, i can't even do it from the command line
all the tutorials i read only confuse me more
i created a executable jar from the command line.
i can execute from the command line by typing java -jar Paint.jar
however when i double click it doesn't work
i think i know why. it was compiled with java7 but windows sees java 6
i need to compile using java 5 or 6
i also need to get java 6 off my machine
 
GeeCON Prague 2014
 
subject: need help deploying executable jar