add java version check
This commit is contained in:
parent
2d1df55e65
commit
05d7f213e5
1 changed files with 15 additions and 0 deletions
|
@ -1,6 +1,8 @@
|
||||||
package game;
|
package game;
|
||||||
|
|
||||||
import java.awt.Desktop;
|
import java.awt.Desktop;
|
||||||
|
import java.awt.GraphicsEnvironment;
|
||||||
|
import java.awt.HeadlessException;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.BufferedInputStream;
|
import java.io.BufferedInputStream;
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
|
@ -37,6 +39,7 @@ import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.FutureTask;
|
import java.util.concurrent.FutureTask;
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
|
||||||
import game.audio.AudioInterface;
|
import game.audio.AudioInterface;
|
||||||
import game.audio.SoundManager;
|
import game.audio.SoundManager;
|
||||||
|
@ -2419,6 +2422,18 @@ public class Game implements IThreadListener {
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
if(!System.getProperty("java.version").startsWith("1.8")) {
|
||||||
|
String info = "Inkompatible Java-Version";
|
||||||
|
String msg = "Java Version 8 ist erforderlich, um dieses Programm auszuführen.\n" +
|
||||||
|
"Neuere Versionen von Java (9 und höher) sind nicht kompatibel.";
|
||||||
|
System.err.println("#################################################################");
|
||||||
|
System.err.println("*** " + info + " ***");
|
||||||
|
System.err.println(msg);
|
||||||
|
System.err.println("#################################################################");
|
||||||
|
if(!GraphicsEnvironment.isHeadless())
|
||||||
|
JOptionPane.showMessageDialog(null, msg, info, JOptionPane.ERROR_MESSAGE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
WCF.init();
|
WCF.init();
|
||||||
Locale.setDefault(Locale.ROOT);
|
Locale.setDefault(Locale.ROOT);
|
||||||
Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {
|
Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue