LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-03-2003, 06:14 AM   #1
titanium_geek
Senior Member
 
Registered: May 2002
Location: Horsham Australia
Distribution: elementary os 5.1
Posts: 2,479

Rep: Reputation: 50
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.]
 
Old 10-03-2003, 06:11 PM   #2
coolman0stress
Member
 
Registered: Jun 2003
Location: Toronto, Ontario, Canada
Posts: 288

Rep: Reputation: 30
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
 
Old 10-03-2003, 11:42 PM   #3
eric.r.turner
Member
 
Registered: Aug 2003
Location: Planet Earth
Distribution: Linux Mint
Posts: 216

Rep: Reputation: 31
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.
 
Old 10-05-2003, 02:46 AM   #4
Robert0380
LQ Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 47
you could also create a batch file with the commands in it to run the program.
 
Old 10-06-2003, 07:03 PM   #5
titanium_geek
Senior Member
 
Registered: May 2002
Location: Horsham Australia
Distribution: elementary os 5.1
Posts: 2,479

Original Poster
Rep: Reputation: 50
thanks guys..
gave me the keywords I needed to do a good Google search.

titanium_geek
 
Old 10-08-2003, 09:30 AM   #6
guest
Member
 
Registered: May 2003
Distribution: CentOS 5 64 bit
Posts: 255

Rep: Reputation: 30
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.
 
Old 10-08-2003, 09:38 AM   #7
guest
Member
 
Registered: May 2003
Distribution: CentOS 5 64 bit
Posts: 255

Rep: Reputation: 30
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
 
Old 10-08-2003, 06:19 PM   #8
titanium_geek
Senior Member
 
Registered: May 2002
Location: Horsham Australia
Distribution: elementary os 5.1
Posts: 2,479

Original Poster
Rep: Reputation: 50
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
 
Old 10-08-2003, 08:25 PM   #9
coolman0stress
Member
 
Registered: Jun 2003
Location: Toronto, Ontario, Canada
Posts: 288

Rep: Reputation: 30
That's sad, you're teacher should know how to search...
 
Old 10-10-2003, 05:56 AM   #10
titanium_geek
Senior Member
 
Registered: May 2002
Location: Horsham Australia
Distribution: elementary os 5.1
Posts: 2,479

Original Poster
Rep: Reputation: 50
hem. It's for extra credit....

titanium_geek
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
java executable files vong'xion Linux - Newbie 3 10-06-2005 08:27 AM
Running a Java executable class from another executable class LUB997 Programming 22 07-24-2005 04:57 AM
Java executable Files John_Emad SUSE / openSUSE 11 06-22-2005 10:01 AM
executable jar in java (cannot double click) spyghost Programming 3 09-29-2003 09:13 AM
compiling a java file to be executable spyghost Programming 5 08-28-2003 07:20 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration