Hank Harrison wrote:Ok so I compiled a java program and converted it to an exe file and it works fine on the computer I created the java file in but when i try it on another computer it gives me a "Java Virtual Machine Launcher - A Java Exception has occured" error message.
Is that ALL it says; or is there more detail?
Any ideas what could be causing this and how i could fix it?
All sorts of things, but it sounds to me like something essential wasn't "packaged" with your exe.
There is a way to compile code with JDK 8 and make it run on older versions of Java: use the -source and -target command line options of the Java compiler. When you do that, however, you cannot use new language features that were added in Java 8. Also, you should not call methods or use classes or interfaces from the standard library that were new in Java 8. Note that the Java compiler will not protect you if you do: it will just compile the code, and when you then later try to run it on Java 7 or older, you might get an error because some method, interface or class does not exist. Therefore, if you want to be sure your code is runnable on an older version of Java, it is better to download and use the JDK for that version, and compile your code with that.