Computing.Net > Forums > Programming > make java program .exe

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

make java program .exe

Reply to Message Icon

Original Message
Name: mullen103
Date: March 24, 2005 at 05:50:37 Pacific
Subject: make java program .exe
OS: xp
CPU/Ram: 256
Comment:

Hello. I am new to java programming. I have made a couple of silly programs but how do i get them to run on another computer. For example to make a vb program work on another computer yoou go to make xxx.exe and its easy but i do not know this for java. I am using netbeans as my environment thanks.

www.mullen103.com


Report Offensive Message For Removal


Response Number 1
Name: kl365
Date: March 24, 2005 at 06:31:04 Pacific
Reply: (edit)

In order to maintain its cross-platform capability, Java uses a Virtual Machine (JVM) to execute its code. This means that you can't create an executable file in the .exe format.

What you can do though is create a .jar (java archive) file that will execute in the same way an .exe file would.

How does this work?

A .jar file is associated with the java app that lets you run your programs. The archive contains a list of the necessary .java files and a special file that tells the JVM how these files relate to each other. Once you've created your archive you can run it just like an .exe file, the only difference is that the .jar file will run on any machine while the .exe is limited to windows.

the sun home page has some good tutorials on how to create and efficiently use .jar's.
good luck!

kl365


Report Offensive Follow Up For Removal







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home








Do you own an iPhone?

Yes
No, but soon
No


View Results

Poll Finishes In 6 Days.
Discuss in The Lounge
Poll History




Data Recovery Software