I have been working on a Java game and I recently wanted to see if others could download and play it. After using Eclipse and making the game into a runnable jar file with the libraries extracted into the project, I had several people download it and try to play. All people had the same problem, the jar wouldn't open. Either as an applet on my website, or just a desktop application. They would get some class error which when I looked it up online meant that they needed to update their Java version. Is there anyway to make it so that my jar file can be used by most, if not all Java versions?
Problem: Jar file cannot be opened by others. Get class error
Assumption: Eclipse is causing the problem
Other Info: I use jre7 and jdk1.7
Eclipse by default is probably compiling for Java 1.7. If your users have a lower version of Java, your program won't be able to run. You need to change the target Java version. In Eclipse,
Regenerate the .jar and it should work (or at least your users should stop getting a version error).
When you use a lower version of Java, note that certain language features and classes may no longer be available. Fortunately, you'll get compiler errors if you accidentally used any of these new features.
You should also post the exact error your users are getting.
I am not claiming to be a pro here Little Willis, but when coding your game you have to keep in mind if you are coding for something like jre7 you may find issues if the user only has jre5 due to update library information that they may be missing. I do not, however; believe that to be the root of your issue. Just something I've missed before.
Can you post the error they get please?
Edit The comment at the bottom of your original post by jahroy and the steps given by Jack Edmonds, outline the problem that I was speaking of and how to remedy it.