LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   java executable (https://www.linuxquestions.org/questions/programming-9/java-executable-99759/)

titanium_geek 10-03-2003 06:14 AM

java executable
 
OK, I know how to run Java from the (DOS) command line, and how to make an applet,
but how do I make an executable Java file?

such as any normal program with an icon that you double click to run the program.

(this is a windows thing, my linux died. sigh)

titanium_geek

[ANY other methods achieving the same end will do for me aswell.]

coolman0stress 10-03-2003 06:11 PM

You can make an executable .jar file but i haven't bothered finding out how yet (i would do it now, but my head really hurts).

Sorry if i couldn't be more helpfull

eric.r.turner 10-03-2003 11:42 PM

You can write a native Windows program (e.g. in C) that invokes the Java Virtual Machine. Details can be found at http://java.sun.com/docs/books/tutor...king/invo.html.

Robert0380 10-05-2003 02:46 AM

you could also create a batch file with the commands in it to run the program.

titanium_geek 10-06-2003 07:03 PM

thanks guys..
gave me the keywords I needed to do a good Google search.

titanium_geek

guest 10-08-2003 09:30 AM

Excutable JAR
 
The key thing for an excutable jar file is to add a manifest file to the jar (.mf file) that states the top level class with the void main(String[]) method in it. I can't think of a program I use off the top of my head that does this (maybe PrettyPrinter), generally people just provide a jar file and .bat/.sh files to execute the class.

guest 10-08-2003 09:38 AM

Manifest File
 
Ahh, I finally thought of a program that uses an excutable jar. Pooka, an all Java email client does. Here is the manifest (I cut all the digest stuff off the bottom):


Manifest-Version: 1.0
Class-Path: activation.jar mbox.jar mail.jar kunststoff.jar jnet.jar j
cert.jar jsse.jar jh.jar
Created-By: Ant 1.4.1
Main-Class: net.suberic.pooka.Pooka

titanium_geek 10-08-2003 06:19 PM

wow. thanks guest.

Ok. here's the "REAL" deal. I'm in a java class, (excuse pun) and my teacher is really curious to find out how to make a java exe file.

titanium_geek

coolman0stress 10-08-2003 08:25 PM

That's sad, you're teacher should know how to search...

titanium_geek 10-10-2003 05:56 AM

hem. It's for extra credit....

titanium_geek


All times are GMT -5. The time now is 06:26 AM.