NexusMain extends org.apache.karaf.main.Main { static void requireMinimumJavaVersion() { if (isNotSupportedVersion(System.getProperty("java.version"))) { System.err.println("Nexus requires minimum java.version: " + MINIMUM_JAVA_VERSION); if (versionCheckRequired()) { System.exit(-1); } } } NexusMain(final String[] args); static void main(final String[] args); @Override void launch();  }
@SuppressWarnings("java:S2699") @Test public void doNotExitWhenGreaterVersion() throws Exception { requireMinimumJavaVersion(); }
@SuppressWarnings("java:S2699") @Test public void doNotExitWhenExactVersion() throws Exception { setVersion(NexusMain.MINIMUM_JAVA_VERSION.toString()); requireMinimumJavaVersion(); }
@Test public void exitOnLowerJavaVersion() throws Exception { System.setProperty("java.version", "1.7"); exit.expectSystemExitWithStatus(-1); requireMinimumJavaVersion(); }