diff --git a/INSTALL-headless.txt b/INSTALL-headless.txt index fac3980ff46261b936a92a784858f0ed0034814a..c009bac20627338ac5106956fc06bd3c84eda664 100644 --- a/INSTALL-headless.txt +++ b/INSTALL-headless.txt @@ -27,6 +27,7 @@ run I2P for the first time. To run I2P explicitly: (*nix): sh i2prouter start (win*): I2P.exe + (Platforms unsupported by the wrapper - PPC, ARM, etc): sh runplain.sh To stop the router (gracefully): lynx http://localhost:7657/configservice.jsp ("Shutdown gracefully") diff --git a/INSTALL.txt b/INSTALL.txt index adbbc5ad51fd29939ed951953970b3c828b03013..acc220c5e8043f3b21af16e4fdae9cdcd58c554c 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -2,6 +2,7 @@ I2P source installation instructions Prerequisites to build from source: Java SDK (preferably Sun) 1.5.0 or higher (1.6 recommended) + The SDK must have Pack200 support (java.util.jar.Pack200) Apache Ant 1.7.0 or higher Optional, For multilanguage support: The xgettext, msgfmt, and msgmerge tools installed from the GNU gettext package http://www.gnu.org/software/gettext/ diff --git a/README.txt b/README.txt index c5ddc12bd89a529fe40e30534ee200446f824b73..c235f89ba0c7d1f755537e802ae65d09fefc8bee 100644 --- a/README.txt +++ b/README.txt @@ -1,5 +1,6 @@ Prerequisites to build from source: Java SDK (preferably Sun) 1.5.0 or higher (1.6 recommended) + The SDK must have Pack200 support (java.util.jar.Pack200) Apache Ant 1.7.0 or higher Optional, For multilanguage support: The xgettext, msgfmt, and msgmerge tools installed from the GNU gettext package http://www.gnu.org/software/gettext/ diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHandler.java index cc8e01bc057b27b41296999d2e5f4fccc232bb6d..b407fe4948ced7dd9180b950de6adaa149e76733 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHandler.java @@ -43,15 +43,34 @@ public class ConfigUpdateHandler extends FormHandler { public static final String PROP_UPDATE_URL = "router.updateURL"; /** - * Changed as of release 0.7.14 from .sud to .su2 - * Update hosts must maintain both for several releases + * Changed as of release 0.8 to support both .sud and .su2 + * Some JVMs (IcedTea) don't have pack200 + * Update hosts must maintain both */ - public static final String DEFAULT_UPDATE_URL = + private static final String PACK200_URLS = "http://echelon.i2p/i2p/i2pupdate.su2\r\n" + "http://stats.i2p/i2p/i2pupdate.su2\r\n" + "http://www.i2p2.i2p/_static/i2pupdate.su2\r\n" + "http://update.postman.i2p/i2pupdate.su2" ; - + + private static final String NO_PACK200_URLS = + "http://echelon.i2p/i2p/i2pupdate.sud\r\n" + + "http://stats.i2p/i2p/i2pupdate.sud\r\n" + + "http://www.i2p2.i2p/_static/i2pupdate.sud\r\n" + + "http://update.postman.i2p/i2pupdate.sud" ; + + public static final String DEFAULT_UPDATE_URL; + static { + String foo; + try { + Class.forName("java.util.jar.Pack200", false, ClassLoader.getSystemClassLoader()); + foo = PACK200_URLS; + } catch (ClassNotFoundException cnfe) { + foo = NO_PACK200_URLS; + } + DEFAULT_UPDATE_URL = foo; + } + public static final String PROP_TRUSTED_KEYS = "router.trustedUpdateKeys"; diff --git a/core/java/src/net/i2p/util/FileUtil.java b/core/java/src/net/i2p/util/FileUtil.java index ef731130183751676eae885472a69010d6503400..ec759e0f28bd49588e2f983d6b959ef1806f3a7e 100644 --- a/core/java/src/net/i2p/util/FileUtil.java +++ b/core/java/src/net/i2p/util/FileUtil.java @@ -133,9 +133,16 @@ public class FileUtil { } in.close(); } catch (IOException ioe) { - System.err.println("ERROR: Error extracting the zip entry (" + entry.getName() + "]"); + System.err.println("ERROR: Error extracting the zip entry (" + entry.getName() + ')'); + if (ioe.getMessage() != null && ioe.getMessage().indexOf("CAFED00D") >= 0) + System.err.println("This may be caused by a packed library that requires Java 1.6, your Java version is: " + + System.getProperty("java.version")); ioe.printStackTrace(); return false; + } catch (Exception e) { // ClassNotFoundException but compiler not happy with that + System.err.println("ERROR: Error unpacking the zip entry (" + entry.getName() + + "), your JVM does not support unpack200"); + return false; } } } @@ -170,6 +177,7 @@ public class FileUtil { byte buf[] = new byte[16*1024]; zip = new ZipFile(zipfile); Enumeration entries = zip.entries(); + boolean p200TestRequired = true; while (entries.hasMoreElements()) { ZipEntry entry = (ZipEntry)entries.nextElement(); if (entry.getName().indexOf("..") != -1) { @@ -179,6 +187,16 @@ public class FileUtil { if (entry.isDirectory()) { // noop } else { + if (p200TestRequired && + (entry.getName().endsWith(".jar.pack") || entry.getName().endsWith(".war.pack"))) { + try { + Class.forName("java.util.jar.Pack200", false, ClassLoader.getSystemClassLoader()); + } catch (Exception e) { // ClassNotFoundException but compiler not happy with that + System.err.println("ERROR: Zip verify failed, your JVM does not support unpack200"); + return false; + } + p200TestRequired = false; + } try { InputStream in = zip.getInputStream(entry); int read = 0; diff --git a/history.txt b/history.txt index 2b317f1383f6771add355f190245456f7f54e52e..381738c064f2a3af65dc33e96fe662f635c2a4f9 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,8 @@ +2010-06-16 zzz + * Console: Sort countries with selected locale + * FileUtil: Try to handle lack of unpack200 support more gracefully + * Update: Select old update URL if no unpack200 available + 2010-06-13 zzz * Console: Add some divs for languages to news and readmes * HTTP Proxy: Pass different User Agent to outproxy diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index 87e5bffca0684477c0ba8daee48da05fbea99f44..282c18b42238909e2faa8bba95d82c15667d116c 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -18,7 +18,7 @@ public class RouterVersion { /** deprecated */ public final static String ID = "Monotone"; public final static String VERSION = CoreVersion.VERSION; - public final static long BUILD = 1; + public final static long BUILD = 2; /** for example "-test" */ public final static String EXTRA = "";