-2

I have created a project in java Netbeans and I want to create an .exe or .jar file that can be run on any other systems. my project have a Main.java class and an other class GetRules.java . the .exe file should be such that it can be run in any folder that contain train.txt as input and create Model.txt as output

how can I do this?

1
  • 2
    For deploying Java desktop apps., the best option is usually to install the app. using Java Web Start. JWS works on Windows, OS X & *nix. Commented Jun 7, 2013 at 6:35

2 Answers 2

0

what you are looking for is an executable file which can execute you project calling you main class

so here is what you can do

step 1 : collect all the files , class files

step 2 : create a jar file collecting all the files from your project

step 3 : this.jar file is executable on any environment with a JVM available

you will have .jar file , rather than .exe file , but serves you the purpose

you can refer this link to learn how to create jar files

Sign up to request clarification or add additional context in comments.

3 Comments

@RezanMoradi : well in that case , just refer the ans of the question , which is marked the duplicate question for you , just visit thatanswer
how can I specify the address of input file such that be independent of my system?
have you gone through the turorial ? , it uses address from onwards your package structure , you dont need to mention the complete path
0

Java programs are not compiled into exe files but Java byte code which is usually stored in jar containers. exe files run on Windows systems only, but Java byte code is platform independent.

What you could do is use a wrapper like Launch4j. It wraps the jar file into an exe file.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.