Remove obsolete Java < 1.6 version check

The parsing throws StringIndexOutOfBoundsException when the version
does not contain '.' such as version "17". This check could never
actually trigger as the class cannot even be loaded on 1.7 or earlier,
so there's no reason to keep it.

Fixes #439
This commit is contained in:
Alex Osborne
2021-09-30 09:59:57 +09:00
parent 698341a1d6
commit 17d760aa78
@@ -192,17 +192,7 @@ public class Heritrix {
System.out.println(System.getProperty("java.vendor")
+ ' ' + System.getProperty("java.runtime.name")
+ ' ' + System.getProperty("java.runtime.version"));
// ensure using java 1.6+ before hitting a later cryptic error
String version = System.getProperty("java.version");
float floatVersion = Float.valueOf(version.substring(0,version.indexOf('.',2)));
if(floatVersion<1.6) {
System.err.println("Heritrix (as of version 3) requires Java 1.6 or higher.");
System.err.println("You attempted to launch with: "+version);
System.err.println("Please try again with a later Java.");
System.exit(1);
}
// Set some system properties early.
// Can't use class names here without loading them.
String ignoredSchemes = "org.archive.net.UURIFactory.ignored-schemes";