Skip to content

Commit

Permalink
不再显示版本提示,请阅读文档
Browse files Browse the repository at this point in the history
  • Loading branch information
zouzg committed Oct 13, 2018
1 parent c8fe12c commit 01360f3
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/main/java/com/zzg/mybatis/generator/MainUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

/**
* 这是本软件的主入口,要运行本软件请直接运行本类就可以了,不用传入任何参数
* 本软件要求jkd版本大于1.8.0.40
*/
public class MainUI extends Application {

Expand All @@ -35,21 +36,7 @@ public void start(Stage primaryStage) throws Exception {
}

public static void main(String[] args) {
String version = System.getProperty("java.version");
if (Integer.parseInt(version.substring(0,1)) == 1 && Integer.parseInt(version.substring(2, 3)) >= 8 && Integer.parseInt(version.substring(6)) >= 60 || Integer.parseInt(version.substring(0,1))>=9) {
launch(args);
}else {
JFrame jFrame = new JFrame("版本错误");
jFrame.setSize(500, 100);
jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel jPanel = new JPanel();
JLabel jLabel = new JLabel("JDK的版本不能低于1.8.0.60,请升级至最近的JDK 1.8再运行此软件,当前版本:" + version);
jPanel.add(jLabel);
jFrame.add(jPanel);
jFrame.setLocationRelativeTo(null);
jFrame.setVisible(true);

}
launch(args);
}

}

0 comments on commit 01360f3

Please sign in to comment.