I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 25fe886e authored by zzz's avatar zzz
Browse files

Update version warnings

Add OpenJDK check for ARM
Uncomment SystemVersion.main()
parent 5a2975ba
No related branches found
No related tags found
No related merge requests found
......@@ -292,8 +292,10 @@ public class RouterConsoleRunner implements RouterApp {
/** @since 0.9.17 */
private void checkJavaVersion() {
boolean noJava7 = !SystemVersion.isJava7();
boolean noPack200 = !FileUtil.isPack200Supported();
if (noJava7 || noPack200) {
boolean noPack200 = (PluginStarter.pluginsEnabled(_context) || !NewsHelper.isUpdateDisabled(_context)) &&
!FileUtil.isPack200Supported();
boolean openARM = SystemVersion.isARM() && SystemVersion.isOpenJDK();
if (noJava7 || noPack200 || openARM) {
String s = "Java version: " + System.getProperty("java.version") +
" OS: " + System.getProperty("os.name") + ' ' +
System.getProperty("os.arch") + ' ' +
......@@ -302,12 +304,17 @@ public class RouterConsoleRunner implements RouterApp {
log.logAlways(net.i2p.util.Log.WARN, s);
System.out.println("Warning: " + s);
if (noJava7) {
s = "Java 7 will be required by late 2015, please upgrade soon";
s = "Java 7 is now required, please upgrade";
log.logAlways(net.i2p.util.Log.WARN, s);
System.out.println("Warning: " + s);
}
if (noPack200) {
s = "Pack200 will be required by late 2015, please upgrade Java soon";
s = "Pack200 is required for plugins and automatic updates, please upgrade Java";
log.logAlways(net.i2p.util.Log.WARN, s);
System.out.println("Warning: " + s);
}
if (openARM) {
s = "OpenJDK is not recommended for ARM. Use Oracle Java 8";
log.logAlways(net.i2p.util.Log.WARN, s);
System.out.println("Warning: " + s);
}
......
......@@ -37,7 +37,7 @@ public class CommandLine {
"net.i2p.util.PartialEepGet",
"net.i2p.util.ShellCommand",
"net.i2p.util.SSLEepGet",
//"net.i2p.util.SystemVersion",
"net.i2p.util.SystemVersion",
"net.i2p.util.TranslateReader",
"net.i2p.util.ZipFileComment"
});
......
......@@ -26,6 +26,7 @@ public abstract class SystemVersion {
private static final boolean _isAndroid;
private static final boolean _isApache;
private static final boolean _isGNU;
private static final boolean _isOpenJDK;
private static final boolean _is64;
private static final boolean _hasWrapper = System.getProperty("wrapper.version") != null;
......@@ -53,6 +54,8 @@ public abstract class SystemVersion {
_isApache = vendor.startsWith("Apache");
_isGNU = vendor.startsWith("GNU Classpath") || // JamVM
vendor.startsWith("Free Software Foundation"); // gij
String runtime = System.getProperty("java.runtime.name");
_isOpenJDK = runtime != null && runtime.contains("OpenJDK");
int sdk = 0;
if (_isAndroid) {
......@@ -110,6 +113,13 @@ public abstract class SystemVersion {
return _isGentoo;
}
/**
* @since 0.9.26
*/
public static boolean isOpenJDK() {
return _isOpenJDK;
}
/**
* @since 0.9.8
*/
......@@ -238,7 +248,6 @@ public abstract class SystemVersion {
/**
* @since 0.9.24
*/
/****
public static void main(String[] args) {
System.out.println("64 bit : " + is64Bit());
System.out.println("Java 6 : " + isJava6());
......@@ -253,11 +262,11 @@ public abstract class SystemVersion {
System.out.println("Mac : " + isMac());
System.out.println("Gentoo : " + isGentoo());
System.out.println("GNU : " + isGNU());
System.out.println("OpenJDK : " + isOpenJDK());
System.out.println("Windows : " + isWindows());
System.out.println("Wrapper : " + hasWrapper());
System.out.println("x86 : " + isX86());
System.out.println("Max mem : " + getMaxMemory());
}
****/
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment