This site requires JavaScript, please enable it in your browser!
Greenfoot back
leney
leney wrote ...

2019/4/28

Greenfoot Jar is not working

leney leney

2019/4/28

#
Hello, I've share/export my greenfoot's scenario to jar application. But, when I ran the jar, nothing happens. I have another jar file (not by greenfoot), it's work well. But, when I try run the jar using bat file (run by java -jar), it's work. Please help me. What's the problem?
nccb nccb

2019/4/29

#
This may be an issue with Java version. If you are double-clicking the JAR in Windows, it will use whatever version of Java happens to be the primary version on your machine. If this is not Java 8 (especially if it's Java 9 or later), that won't currently work well with Greenfoot's exported JARs, which currently only work with Java 8 (until we update to Java 9+ in future). Best work-around is to use a batch file as you describe -- you can try changing which Java is associated with .jar files but it's probably more trouble than it's worth, especially if other applications on your system need the newer Java.
You need to login to post a reply.