This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Java in General and the fly likes Executing a Java program on a different machine Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Executing a Java program on a different machine" Watch "Executing a Java program on a different machine" New topic

Executing a Java program on a different machine

Tim frank

Joined: Mar 07, 2006
Posts: 25
recently i've made a java program consisting of 4 classes, is there any way I can make this into a file that will run on other machines, something like a C++ .exe file? I've heard about JAR files, but not really too sure what they are.
Can anyone help, I really want to have some way of installing/running my program on other machines?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13883

Make sure a JRE (Java Runtime Environment) of the right version is installed on the other machine and then you can run your Java program without trouble.

You can't drive a car that doesn't have an engine installed, so to run a Java program, you must have Java installed on the computer.

If you're not sure that your users will have Java installed, you could create a setup program for your Java program with for example IzPack. It can automatically download and install Java on a computer if necessary while installing your program.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
I agree. Here's the link:
subject: Executing a Java program on a different machine
Similar Threads
Issue with a Java RMI application not working on other machines
How To make Enterprise Application use Java Web Start
Running an executable Jar file from another Java Program
perl script sending signals to java
How to upload a file of size >8GB ?