-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathVersionCheckLauncher.java
More file actions
68 lines (52 loc) · 2.21 KB
/
Copy pathVersionCheckLauncher.java
File metadata and controls
68 lines (52 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package com.application.areca.version;
import javax.swing.JOptionPane;
import org.eclipse.swt.widgets.Display;
import com.application.areca.ArecaConfiguration;
import com.myJava.system.OSTool;
import com.myJava.util.log.Logger;
/**
* <BR>
* @author Olivier PETRUCCI
* <BR>
*
*/
/*
Copyright 2005-2015, Olivier PETRUCCI.
This file is part of Areca.
Areca is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Areca is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Areca; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
public class VersionCheckLauncher {
public static void main(String[] args) {
try {
checkJavaVersion();
ArecaConfiguration.initialize();
VersionCheckWindow check = new VersionCheckWindow();
check.setBlockOnOpen(true);
check.open();
Display.getCurrent().dispose();
} catch (Throwable e) {
e.printStackTrace();
Logger.defaultLogger().error("Unexpected error", e);
}
}
private static void checkJavaVersion() {
if (! OSTool.isJavaVersionGreaterThanOrEquals(VersionInfos.REQUIRED_JAVA_VERSION)) {
System.out.println("----------------------------------------------------------------------------------\n ");
System.out.println(VersionInfos.VERSION_MSG);
System.out.println("----------------------------------------------------------------------------------");
JOptionPane.showMessageDialog(null,
VersionInfos.VERSION_MSG, VersionInfos.APP_NAME + " - Invalid Java Version", JOptionPane.ERROR_MESSAGE);
System.exit(-1);
}
}
}