0

I have a finished program that I created a JAR executable from (I created this in eclipse), and I need to download this executable onto computers different from the one that I wrote the program on.

However, I am getting the problem that when I try and download the executable onto the computers, I get the window that pops up that says that "Windows can't open this file" and it then gives me a list of programs that I can open the file with, none of which I can use. I do not need to do this on the computer on which I wrote the program. When I double-click the executable on that computer, the program starts without any trouble.

lb91
  • 109
  • 9
  • 2
    Is Java installed on the other computer? – Oisin Mar 29 '16 at 23:25
  • 1
    Do you mean the runtime environment? – lb91 Mar 29 '16 at 23:26
  • Java doesn't come with Windows, and if your .jar file runs on your pc by double-clicking it, it's because it's got a file association and a classpath set in the environment. None of those things happen by default, which is probably why it's not working on any other PCs. – LinuxDisciple Mar 29 '16 at 23:30

2 Answers2

2

In order to run Java programs, you have to install the Java Runtime Environment (JRE). The Java Development Kit (JDK) is not needed. You can download the latest version (JRE) here.

If you want to learn more about JVM, JRE and JDK, you can read the answer to this question.

Community
  • 1
  • 1
Mario Dekena
  • 843
  • 6
  • 20
-2

This is cause you need install Java in the remote machines including the JDK, then also you need to make java available through console installing Ant wherever it applies.

  • "...also you need to make java available through console installing Ant wherever it applies." I don't understand what you mean by this. – lb91 Mar 29 '16 at 23:30
  • 1
    You don't need the JDK to run .jars, just the JRE. You also don't need ant, though if you're going to use ant, it needs the JRE. – LinuxDisciple Mar 29 '16 at 23:31