473,396 Members | 1,915 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

.class -> .exe?

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
4 5229
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Fernando Rodriguez | last post by:
Hi, I need to traverse the methods defined in a class and its superclasses. This is the code I'm using: # An instance of class B should be able to check all the methods defined in B #and A,...
18
by: John M. Gabriele | last post by:
I've done some C++ and Java in the past, and have recently learned a fair amount of Python. One thing I still really don't get though is the difference between class methods and instance methods. I...
1
by: Oplec | last post by:
Hi, I'm learning C++ as a hobby using The C++ Programming Language : Special Edition by Bjarne Stroustrup. I'm working on chpater 13 exercises that deal with templates. Exercise 13.9 asks for me...
13
by: Bryan Parkoff | last post by:
I have created three classes according to my own design. First class is called CMain. It is the Top Class. Second class and third class are called CMemory and CMPU. They are the sub-classes....
9
by: Banaticus Bart | last post by:
I wrote an abstract base class from which I've derived a few other classes. I'd like to create a base class array where each element is an instance of a derived object. I can create a base class...
8
by: Bryan Parkoff | last post by:
I find an interesting issue that one base class has only one copy for each derived class. It looks like that one base class will be copied into three base classes while derived class from base...
21
by: Jon Slaughter | last post by:
I have a class that is basicaly duplicated throughout several files with only members names changing according to the class name yet with virtually the exact same coding going on. e.g. class...
5
by: Andy | last post by:
Hi all, I have a site with the following architecture: Common.Web.dll - Contains a CommonPageBase class which inherits System.Web.UI.Page myadd.dll - Contains PageBase which inherits...
3
by: Hamilton Woods | last post by:
Diehards, I developed a template matrix class back around 1992 using Borland C++ 4.5 (ancestor of C++ Builder) and haven't touched it until a few days ago. I pulled it from the freezer and...
0
by: emin.shopper | last post by:
I had a need recently to check if my subclasses properly implemented the desired interface and wished that I could use something like an abstract base class in python. After reading up on metaclass...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.