By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,032 Members | 825 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,032 IT Pros & Developers. It's quick & easy.

.class -> .exe?

P: n/a
Lately I've been annoyed by having to run my Java programs from either
the IDE or the command line. Is there a way to make a Java program
executable that doesn't involve using a script in C++ (or some other
language) to run it with a System Call?
Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Colin McSwiggen wrote:
Lately I've been annoyed by having to run my Java programs from either
the IDE or the command line. Is there a way to make a Java program
executable that doesn't involve using a script in C++ (or some other
language) to run it with a System Call?


You don't say what OS, but generally speaking the easiest way is to make
your Java app into an executable jar file. Then the command to run it is
just 'java -jar myapp.jar': every GUI desktop I've worked with (starting
with Atari GEM) has had an easy way to set up an association that will run
this command when the icon is "opened" / double-clicked.

--
Chris Gray ch***@kiffer.eunet.be

Jul 17 '05 #2

P: n/a
Hi Colin,

Check out the page
http://www.geocities.com/SiliconVall...686/jcomp.html and
especially the section
http://www.geocities.com/SiliconVall...nativeproducts for some inspiration on what you can do to solve your problem.
Another resource is this http://gcc.gnu.org/java/ which is a project for translating Java source code to native code.

Best regards
Kristian

On Tue, 11 Nov 2003 12:56:41 -0800, Colin McSwiggen wrote:
Lately I've been annoyed by having to run my Java programs from either
the IDE or the command line. Is there a way to make a Java program
executable that doesn't involve using a script in C++ (or some other
language) to run it with a System Call?


Jul 17 '05 #3

P: n/a
cs****@myway.com (Colin McSwiggen) wrote in message news:<fb**************************@posting.google. com>...
Lately I've been annoyed by having to run my Java programs from either
the IDE or the command line. Is there a way to make a Java program
executable that doesn't involve using a script in C++ (or some other
language) to run it with a System Call?


Even though the odds are that you are not using a Macintosh: Mac OS X
allows jar files to be double-clicked in the Finder. Also, a program
called Jar Bundler comes with the Xcode developer tools to "package"
your jar file(s) in a more "application-like" manner.

http://developer.apple.com/java/
Jul 17 '05 #4

P: n/a
cs****@myway.com (Colin McSwiggen) wrote in message news:<fb**************************@posting.google. com>...
Lately I've been annoyed by having to run my Java programs from either
the IDE or the command line. Is there a way to make a Java program
executable that doesn't involve using a script in C++ (or some other
language) to run it with a System Call?
hi
i was also irritated by invoking java frm cmd prompt or IDE tools.
i found a solution which is a small program in c (i wrote by myself
with the help of some online tutorial ... i dun rem clearly but i
guess from some reference on roedy green's site)
with this, you can double click your .class files to run them like
normal .exe files ....
its for WIN* users
features support for command line options, parameters
if the class has main method , you can run it by double clicking it
it uses windows association features to associate .class with this program
no need to convert .class into native code


all you need to do is double click any .class file it will ask for
program to associate with ... locate this program henceforth you dont
have to invoke java from command prompt
if you need it, i shall mail it to you ....
or you can search for tut n write it yourself ...its damnnn easy

regards
amey
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.