0

Okay so I have a project that I would like to export from eclipse and have it as an application that can be transferred to other computers and will run on its own. I honestly do not know where to begin. If this is a complicated process that cannot be explained here, please point me to where I need to begin. I am okay with Java programming (still pretty new). This program is relatively simple with the exception of a few class and complicated equations. When it runs, it asks for user input and it outputs some values. Thank you

edit- there is not GUI. The user interaction is all text based

handroski
  • 81
  • 2
  • 3
  • 15

4 Answers4

1

You can build your project and then it will give you a jar file. This can be run on any PC with a JRE installed. I think your project is console based or GUI based app.

Don Srinath
  • 1,565
  • 1
  • 21
  • 32
1

You can run your program as a runnable jar if I understood your question correctly.. You just need java installed in other computers.

You can follow this tutorial

arsenal
  • 23,366
  • 85
  • 225
  • 331
1

There are two steps:

  1. Create a launch configuration in Eclipse. Therewith main-class and so on gets configured.
  2. Follow this guide to export a runnable jar based on the above launch configuration.

Prequisits on other PC: You can use this jar on other PCs if they have a compatible Java Runtime installed. Compatible means that your the Java versions are compatible and that you should not compile and export a 64bit program and deploy it on a 32bit (vice versa should work though).

chris.tian
  • 770
  • 5
  • 13
1

As all the other answers indicate, firstly you need to build a JAR to bundle all your classes etc. How you do this has already been answered here. You can then move this JAR file around to execute it on other computers that also have (a compatible) Java Runtime Environment (JRE) installed.

Now to actually run your jar, you do so from the command line where your JAR is located:
java -jar <YOUR_JAR_NAME>.jar <Parameters for your main method if any>.

Also make sure you also have java on your PATH

Community
  • 1
  • 1
xlm
  • 6,854
  • 14
  • 53
  • 55