Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-31-2003, 05:33 AM   PM User | #1
weronpc
Regular Coder

 
Join Date: Apr 2003
Location: Canada, Ontario, Mississauga
Posts: 312
Thanks: 0
Thanked 0 Times in 0 Posts
weronpc is an unknown quantity at this point
Java excutable

Hello everyone,

I had been working with Java for 4 months,

Do anyone know how to make java file (*.class) into an excutable file?

I want to send some program I wrote to my friends..

Thank you all...
weronpc is offline   Reply With Quote
Old 09-01-2003, 08:16 PM   PM User | #2
Roelf
Senior Coder

 
Join Date: Jun 2002
Location: Zwolle, The Netherlands
Posts: 1,110
Thanks: 2
Thanked 28 Times in 28 Posts
Roelf is on a distinguished road
it is possible to create a jar-file with some statement in it to define the startup class. doubleclickin the jar-file executes the specified class.
How its done precisely i can tell you tomorrow (about 10 hours after this post)
__________________
I am the luckiest man in the world
Roelf is offline   Reply With Quote
Old 09-01-2003, 08:20 PM   PM User | #3
liorean
The thread killer


 
Join Date: Feb 2003
Location: Umeå, Sweden
Posts: 5,575
Thanks: 0
Thanked 84 Times in 75 Posts
liorean will become famous soon enoughliorean will become famous soon enough
Well, you can search the web for a Java-->native executable compiler. I believe most are commersial and might cost a little, however.
__________________
liorean <[lio@wg]>
Articles: RegEx evolt wsabstract , Named Arguments
Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards
liorean is offline   Reply With Quote
Old 09-02-2003, 06:52 AM   PM User | #4
Roelf
Senior Coder

 
Join Date: Jun 2002
Location: Zwolle, The Netherlands
Posts: 1,110
Thanks: 2
Thanked 28 Times in 28 Posts
Roelf is on a distinguished road
create the jar-file, with your classes in it. In the jar-file, create a folder called Meta-inf with a text-file in it named Manifest.mf
The file should contain the following information:

Main-Class: path.to.your.main.class.which.will.be.executed

success with it
__________________
I am the luckiest man in the world
Roelf is offline   Reply With Quote
Old 09-02-2003, 03:54 PM   PM User | #5
liorean
The thread killer


 
Join Date: Feb 2003
Location: Umeå, Sweden
Posts: 5,575
Thanks: 0
Thanked 84 Times in 75 Posts
liorean will become famous soon enoughliorean will become famous soon enough
Well, a jar file isn't an executable - it cannot be run on it's own and most setups open it with winzip/winrar or not at all instead of running it (which requires a virtual machine installed, which isn't always the case either). A jar file is essentially a zip file with some extra internal structure-interpretation added.
__________________
liorean <[lio@wg]>
Articles: RegEx evolt wsabstract , Named Arguments
Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards
liorean is offline   Reply With Quote
Old 09-03-2003, 06:56 AM   PM User | #6
Roelf
Senior Coder

 
Join Date: Jun 2002
Location: Zwolle, The Netherlands
Posts: 1,110
Thanks: 2
Thanked 28 Times in 28 Posts
Roelf is on a distinguished road
but he wants to send some programs he wrote to his friends, he can make sure they have a virtual machine installed and the whole thing will work. no less, no more
__________________
I am the luckiest man in the world
Roelf is offline   Reply With Quote
Old 09-03-2003, 01:17 PM   PM User | #7
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,234
Thanks: 4
Thanked 81 Times in 80 Posts
Spookster will become famous soon enough
Quote:
Originally posted by liorean
Well, a jar file isn't an executable -
Actually as far as packaging and starting up your Java application it is. Using a jar file is a common way of doing that. Not sure why you would argue about it.
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Spookster is online now   Reply With Quote
Old 09-03-2003, 04:01 PM   PM User | #8
liorean
The thread killer


 
Join Date: Feb 2003
Location: Umeå, Sweden
Posts: 5,575
Thanks: 0
Thanked 84 Times in 75 Posts
liorean will become famous soon enoughliorean will become famous soon enough
Well, it's a good way of packaging a java application, but it can't be run on it's own, and is not by default run by a java virtual machine in win95 through win2k at least.

Besides, a file that can not be run natively in an OS without a parser, interpreter, compiler or virtual machine, is not an executable.
__________________
liorean <[lio@wg]>
Articles: RegEx evolt wsabstract , Named Arguments
Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards
liorean is offline   Reply With Quote
Old 09-03-2003, 05:26 PM   PM User | #9
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,234
Thanks: 4
Thanked 81 Times in 80 Posts
Spookster will become famous soon enough
Quote:
Originally posted by liorean
Well, it's a good way of packaging a java application, but it can't be run on it's own
Nobody here was arguing that it couldn't be run on it's own. Of course it needs the JVM installed. That is what makes java so portable.

Quote:
Originally posted by liorean
and is not by default run by a java virtual machine in win95 through win2k at least.
Last time I worked with jar files I seem to recall that you only needed to double click on the jar file to start up your application. And that was on several different versions of MS Windows. No file associations needed to be made. With the JDK installed the jar files will be run by the JVM.


Quote:
Originally posted by liorean
Besides, a file that can not be run natively in an OS without a parser, interpreter, compiler or virtual machine, is not an executable.
How do you figure that? Did you make up that definition of what an executable file is yourself?

Besides all of that you seem to be missing the whole point of weronpc's question. He just wants his friends to be able to run an application he wrote in Java. He can package it up into a jar file and then just ensure his friends have the JVM installed and then all they need to do is double click the jar file.
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Spookster is online now   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:18 PM.


Advertisement
Log in to turn off these ads.