I created a program in Java 1.8 using eclipse, then I exported it into an executable JAR file and it runs fine on my computer, but if I try too run it on a different computer it tells me I need to install a JDK to run it(also something about command line tools). Is there any way to make eclipse export an executable jar that doesn't require a JDK to run
Asked
Active
Viewed 1,760 times
0
-
JARs need a JRE, not a JDK. What command are you running, and what error do you get? – SLaks Sep 20 '15 at 01:01
-
I am running an executable jar file, on a mac, and the error is: To use the "java -jar AI_Eclipse.jar" command line tool you need to install a JDK – Gregory Preston Sep 20 '15 at 01:09
-
Googling it, it sounds like that error is just wrong; a JRE should be fine. – SLaks Sep 20 '15 at 01:10
-
I know it makes no sense but it isn't working all the same – Gregory Preston Sep 20 '15 at 01:12
-
The Mac has java installed – Gregory Preston Sep 20 '15 at 01:15
-
I found this: https://www.youtube.com/watch?v=42ro3PZTwUo and it is a very similar error – Gregory Preston Sep 20 '15 at 01:25
-
Does the solution in that link work for you? – Andreas Sep 20 '15 at 01:29
1 Answers
0
Check Answer from this question
How is Java platform-independent when it needs a JVM to run?
You will need JRE on target environment to run your program.
-
-
In short you need a JRE which is Java Runtime Environment. Executable jars dont behave like EXE files. Executable jars are run by Java Virtual Machine which is part of JRE whereas Executable files are machine level instructions. http://www.javabeat.net/what-is-the-difference-between-jrejvm-and-jdk/ – DhruvG Sep 20 '15 at 01:15