0

How can I send my java application to a friend without having to send the entire project and being dependent on him having JDK? I'm aware of the .jar-file's existence, but I don't know how to proceed. I would like to be able to just send him the .jar-file or an executable file.

Any ideas?

4
  • 1
    If you send the JAR, he dows not need to have the JDK; he just needs the JRE (the program at java.com) Commented May 17, 2013 at 18:45
  • If you work with NetBeans, when you "build" your project, a dist folder is generated, and your "packed" app is stored there. You can send the contents of this folder. Read the "readme" file in that folder. Commented May 17, 2013 at 18:47
  • Which IDE are you using? Or are you doing it all by hand? Commented May 17, 2013 at 18:47
  • Thank you @Barranka, using the dist folder works somewhat like I wanted. I'm using NetBeans as you suggested. Commented May 17, 2013 at 19:05

4 Answers 4

1

Compile it to native code using a compiler such as http://en.wikipedia.org/wiki/GNU_Compiler_for_Java

Also, he doesn't need the JDK, just the JRE.

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

2 Comments

GCJ is a dead project and moreover it does not support all Java features such as AWT and Swing
So consider the use of Excelsior jet, but it is overkill for just not have to download a JRE :)
0

Did what @Barranka said regarding the dist folder, didn't know that worked until I read the readme file as @Barranka suggested.

So to quote what @Barranka said:

If you work with NetBeans, when you "build" your project, a dist folder is generated, and your "packed" app is stored there. You can send the contents of this folder. Read the "readme" file in that folder. – Barranka

1 Comment

Your friend still have to download a JRE if it doesn't have one.
0

You can send the JAR file alone provided your program does not depend on other libraries. Assuming that there is a main() method and Main Class is configured in the JAR's manifest, the person can run it by Double Clicking (on windows) or use the command line

java -jar <jar_file_name>.jar

Comments

0

You cannot execute a Java application without a Java Virtual Machine, so you need one. Your friend has to download a JRE/JDK, or you can provide it with your application directly as it (the JRE and your project in an archive) or provide it as a native compile code using GCJ or Excelsior Jet which will compile your application and a JRE.

As you can see the is no solution for your question, but there is one for your problem : ask your friend to download a JRE.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.