一定要改正啊啊

This commit is contained in:
zhoudaxia 2016-08-26 11:01:18 +08:00
parent f8948118bd
commit 8e20070a07
1 changed files with 5 additions and 7 deletions

View File

@ -9,7 +9,6 @@ package net.sf.robocode.installer;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -34,12 +33,11 @@ public class AutoExtract implements ActionListener {
private static File installDir; private static File installDir;
private static final String javaVersion = System.getProperty("java.version"); private static final String javaVersion = System.getProperty("java.version");
private boolean acceptLicense() throws IOException { private boolean acceptLicense() {
String licenseText = ""; String licenseText = "";
InputStream is; InputStream is;
JarFile extractJar;
JarFile extractJar = null;
try { try {
extractJar = new JarFile("extract.jar"); extractJar = new JarFile("extract.jar");
@ -47,8 +45,8 @@ public class AutoExtract implements ActionListener {
} catch (IOException e) { } catch (IOException e) {
return true; return true;
} finally{ } finally{
extractJar.close(); extractJar.close();
} }
if (is == null) { if (is == null) {
return true; return true;
} }
@ -229,7 +227,7 @@ public class AutoExtract implements ActionListener {
} }
} }
public static void main(String argv[]) throws HeadlessException, IOException { public static void main(String argv[]) {
// Verify that the Java version is version 6 (1.6.0) or newer // Verify that the Java version is version 6 (1.6.0) or newer
if (javaVersion.startsWith("1.") && javaVersion.charAt(2) < '5') { if (javaVersion.startsWith("1.") && javaVersion.charAt(2) < '5') {
final String message = "Robocode requires Java 6 (1.6.0) or newer.\n" final String message = "Robocode requires Java 6 (1.6.0) or newer.\n"