473,804 Members | 2,280 Online
Bytes | Software Development & Data Engineering Community
+ 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 28935
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.co m (QQ June) wrote in message news:<56******* *************** ****@posting.go ogle.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.co m (QQ June) wrote in message news:<56******* *************** ****@posting.go ogle.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_argumen ts
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************* *************@p osting.google.c om, "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.c om> wrote in message
news:56******** *************** ***@posting.goo gle.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

Jul 17 '05 #7

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

Similar topics

9
11546
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 the jar file. Here is the criteria of what I am working with: ----------------------------------------------- Working directory: ------------------
0
1238
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 executable.So while that executable is running,if I try to stop the windows service while
1
282
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 the /bin/debug folder. Is there a fix for this?
1
3403
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 instance, I've associated all .py files to be opened up with emacs.exe. If I double click on a .py file, emacs.exe would open up with that file in its buffer.
2
1937
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 following (Where "MyProgram.exe" is my new VB,net creation) When the user runs Setup.exe, he is presented with the choice of installing to \Program Files\MyProgram or a location of his choosing. Setup copies all the files to that location,...
1
2819
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 anyone can help me with this.. "I have created a deployment project for a .NET program which opens a file with a custom extension. I have added the file type to the deployment project. After installation, double clicking a file with that...
2
1587
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 file to be sent as JAR. They need a makefile in it so that they can invoke make command to compile the project. To run the project, they want to give a name project1. Also this project1 should be able to be invoked from any directory. Can anybody...
2
2221
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 are used for program configuration (similar to the way an INI file is used.) These file may change per installation, so I may need to edit them. Having them wrapped up in the EXE just won't work for my needs. I've used the 'exclude' option to...
20
3795
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 do this. My tab delimited Input File looks like this:- 21 p 13e 0 62 1 580001 andrew -14.53 -13.95 0 0 21 p 13d 63 124 580002 1160001 andrew -13.95 -13.37 0 0 21 p 12g 311 364 2900000 3385714 john -11.63 -11.14 0 0 21 q 11.1a 1274 1321...
0
9714
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9594
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10346
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10347
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10090
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6863
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5531
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4308
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 we have to send another system
2
3832
muto222
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.