473,473 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to make a executable file, such as myprogram.exe, for java ?

Hello,

I have some java classes. But, I don't want my users to type "java
my_java_program" every time they run the java class ?
How do I pack them together into one executable file, like
myprogram.exe. ?
Any tools can do this for me ??

Thanks & regards,
June
Jul 17 '05 #1
6 28899
QQ June wrote:
Hello,

I have some java classes. But, I don't want my users to type "java
my_java_program" every time they run the java class ?
How do I pack them together into one executable file, like
myprogram.exe. ?
Any tools can do this for me ??


This is the sort of thing that scripting languages are for.

Creating an EXE file out of Java sources is generally evil. Java is
designed to be completely platform-neutral -- your .class files are able
to run on any OS and hardware platform. As soon as you package them
into an EXE file, however, you've now locked your code to run on ONE OS
on ONE hardware platform.

Instead of doing this, package your classes into a runnable JAR file.
Then create a script that will launch it for the user.

HTH!

Brad BARCLAY

--
=-=-=-=-=-=-=-=-=
From the OS/2 WARP v4.5 Desktop of Brad BARCLAY.
The jSyncManager Project: http://www.jsyncmanager.org


Jul 17 '05 #2
On Thu, 02 Oct 2003 09:15:27 -0700, QQ June wrote:
Hello,

I have some java classes. But, I don't want my users to type "java
my_java_program" every time they run the java class ?
How do I pack them together into one executable file, like
myprogram.exe. ?
Any tools can do this for me ??

Thanks & regards,
June


Hi June,

I have already seen one reply on this suggesting you to wrap the Java
program in a script containg the something like java my_java_program. If
it is native code (so you can run it on a machine without a Java VM, javac
will not help you) you
have to buy a special compiler for that if it is for
Windows (I have not seen any free ones for Windows yet). For Linux you
could use gcc with the option for Java code, but that is only for Linux
native code.

Best Regards
Kristian
Jul 17 '05 #3
qk****@yahoo.com (QQ June) wrote in message news:<56**************************@posting.google. com>...
Hello,

I have some java classes. But, I don't want my users to type "java
my_java_program" every time they run the java class ?
How do I pack them together into one executable file, like
myprogram.exe. ?
Any tools can do this for me ??

Thanks & regards,
June


Check out JSmooth, http://jsmooth.sourceforge.net/index.php If you
must make it an .exe.

Stian
Jul 17 '05 #4
qk****@yahoo.com (QQ June) wrote in message news:<56**************************@posting.google. com>...
Hello,

I have some java classes. But, I don't want my users to type "java
my_java_program" every time they run the java class ?
How do I pack them together into one executable file, like
myprogram.exe. ?
Any tools can do this for me ?? Thanks & regards,
June


hi there
i have written a c program that invokes java for you & you can also
provide any options or command line arguments .....
no support yet provided for .jar files (work in progress)

if you require it, i can mail it to you

its a simple .exe file which you can associate with your .class files
& then you can run your .class files just by double clicking them from
explorer
or even lets say if your file is Demo.class then you can run it at
command prompt

c:\ur_dir>Demo.class

i picked it up from an online tutorial.
if you want to write one heres the logic

parse your input & remove .class extension & also absolute path
provided if any
accept options switches
accept command line arguments
form a complete string with "java.exe " + options + class_name +
cmdline_arguments
invoke it & you are done.

remember the file does not touch your .class files, it just makes use
of windows file association feature.

regards
amey
Jul 17 '05 #5
On 10/4/03 1:37 AM, in article
66**************************@posting.google.com, "Amey Samant"
<am*****@yahoo.com> wrote:
Hello,

I have some java classes. But, I don't want my users to type "java
my_java_program" every time they run the java class ?
How do I pack them together into one executable file, like
myprogram.exe. ?
Any tools can do this for me ??

Thanks & regards,
June


hi there
i have written a c program that invokes java for you & you can also
provide any options or command line arguments .....
no support yet provided for .jar files (work in progress)


Borland's JBuilder has the ability to do this. The price is steep, though.
Anthony

--
Got a 'blog? Post it: http://www.martin-studio.com/weblog-index/

Jul 17 '05 #6
Why don't you just write a DOS .bat file to do this?

I remember there was a utility to convert a DOS batch file to an .exe if you
need to run as an .EXE file.

"QQ June" <qk****@yahoo.com> wrote in message
news:56**************************@posting.google.c om...
Hello,

I have some java classes. But, I don't want my users to type "java
my_java_program" every time they run the java class ?
How do I pack them together into one executable file, like
myprogram.exe. ?
Any tools can do this for me ??

Thanks & regards,
June

Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Eric | last post by:
Problem: -------- I'm trying to create an executable jar file. I can do so as long as I don't use the "package" statement in my source code. Once I put the package statement in I can't execute...
0
by: belgi | last post by:
Hi, I have a working windows service,it is looking for files on the disk and when some of the files are cupdated it calls an executable. But it takes a lot of time(about 10 minutes) to run the...
1
by: Todd | last post by:
I just upgraded from the 2002.net to the 2003.net. I had been using a ..config file for database conection info. Now when I compile my application to debug the config file is being deleted out of...
1
by: knutsample | last post by:
Hello! I'm trying to associate a file extension to my wxPython script so that all I have to do is double click on the file and my python script will load up with the path of that file. For...
2
by: | last post by:
I am new to Visual Basic.Net using the Standard Edition, which does not come with a Deployment wizard, so I use the template on the File Systems Tab. Everything works fine, and I have enabled the...
1
by: Paul Sullivan | last post by:
I have encountered the same problem another posted about several months ago. Unfortunately, there was no result posted on the old thread. I will let the original message text stand and ask if...
2
by: somyav | last post by:
Hi, I need some guidance on how to turn in the java programs as a executable. My requirement is this: I have a package(with .java and .class files) that I am sending it to my clients. They want the...
2
by: ward.david | last post by:
I am using py2exe to generate an executable so that I can deliver my scripts as a EXE. I have a couple of file that are needed by the program that I do not want to include in the EXE because they...
20
by: cowboyrocks2009 | last post by:
Hi, I need help to automate my code to take data from input file. Also I need to create it as a function so that I can pass it to some other program. I am new to Java so having a bit limitation to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.