Updated README

This commit is contained in:
knaccc
2019-01-16 07:40:19 +00:00
parent 6de54e7396
commit cd1c39a6ea
6 changed files with 46 additions and 21 deletions
+12 -6
View File
@@ -1,8 +1,8 @@
# Embedded I2P Java Router with SAM interface
This project will build a native launcher. The launcher will include the I2P router, a SAM listener and a minimal JVM.
This project will run under Linux, and build native launchers for Linux, MacOS and Windows. The launchers will include the I2P router, a SAM listener and a minimal JVM.
## Building the launcher
## Building the launchers
First, retrieve this project from git:
@@ -12,6 +12,8 @@ Note that the current version of this script uses jdk-11.0.2. If this version of
download, then update the references to jdk-11.0.2 in this folder structure to the later version. To locate a recent
JDK download URL, see https://jdk.java.net/11/
Also note that JDKs for Linux, MacOS and Windows will be downloaded, which will total several hundred megabytes.
Run the `bin/build-all.sh` script, which will in turn call the following scripts:
1. `bin/import-packages.sh` to retrieve the I2P Java sources, OpenJDK and the Ant build tool
@@ -19,13 +21,17 @@ Run the `bin/build-all.sh` script, which will in turn call the following scripts
2. `bin/build-original-i2p.sh` to build the I2P project retrieved from the I2P repository
3. `build-launcher.sh` to convert the I2P JARs to modules, compile the Java source code in this project, and then use
the jlink tool to build a zero-dependency platform-specific launcher.
the jlink tool to build a zero-dependency platform-specific launchers.
## Running the launcher
## Running the launchers
To run the router, type:
To run the Linux or MacOS router, type:
`dist/router/bin/launch.sh`
`dist/linux/router/bin/launch.sh`
For Windows, run:
`dist/windows/router/bin/launch.bat`
If it launches successfully, you'll see the message:
+18 -10
View File
@@ -2,7 +2,7 @@
basedir=$(dirname $(dirname $(readlink -fm $0)))
export JAVA_HOME=`realpath $basedir/import/jdk-11.0.2`
export JAVA_HOME=`realpath $basedir/import/jdks/linux/jdk-11.0.2`
# convert the jar files from an existing I2P build into modules suitable for use with jlink
$basedir/bin/convert-jars-to-modules.sh
@@ -15,17 +15,25 @@ $JAVA_HOME/bin/javac --module-path import/lib -d target/classes $(find src -name
echo "*** Packaging as a modular jar"
$JAVA_HOME/bin/jar --create --file target/org.getmonero.i2p.embedded.jar --main-class org.getmonero.i2p.embedded.Main -C target/classes .
# create an OS specific launcher which will bundle together the code and a minimal JVM
echo "*** Performing jlink"
$JAVA_HOME/bin/jlink --module-path target/modules:target/org.getmonero.i2p.embedded.jar --add-modules org.getmonero.i2p.embedded --launcher router=org.getmonero.i2p.embedded --output target/router --strip-debug --compress 2 --no-header-files --no-man-pages
mkdir -p $basedir/dist/linux $basedir/dist/mac $basedir/dist/win
cp $basedir/resources/launch.sh $basedir/target/router/bin/
# create OS specific launchers which will bundle together the code and a minimal JVM
echo "*** Performing jlink (Linux)"
$JAVA_HOME/bin/jlink --module-path $JAVA_HOME/jmods:target/modules:target/org.getmonero.i2p.embedded.jar --add-modules org.getmonero.i2p.embedded --launcher router=org.getmonero.i2p.embedded --output dist/linux/router --strip-debug --compress 2 --no-header-files --no-man-pages
cp -r $basedir/import/i2p.base $basedir/target/router/
mkdir -p $basedir/target/router/i2p.config
echo "*** Performing jlink (Mac)"
$JAVA_HOME/bin/jlink --module-path $basedir/import/jdks/mac/jdk-11.0.2.jdk/Contents/Home/jmods:target/modules:target/org.getmonero.i2p.embedded.jar --add-modules org.getmonero.i2p.embedded --launcher router=org.getmonero.i2p.embedded --output dist/mac/router --strip-debug --compress 2 --no-header-files --no-man-pages
mkdir -p $basedir/dist/
mv $basedir/target/router $basedir/dist/
echo "*** Performing jlink (Windows)"
$JAVA_HOME/bin/jlink --module-path $basedir/import/jdks/win/jdk-11.0.2/jmods:target/modules:target/org.getmonero.i2p.embedded.jar --add-modules org.getmonero.i2p.embedded --launcher router=org.getmonero.i2p.embedded --output dist/win/router --strip-debug --compress 2 --no-header-files --no-man-pages
cp $basedir/resources/launch.sh $basedir/dist/linux/router/bin/
cp $basedir/resources/launch.sh $basedir/dist/mac/router/bin/
cp $basedir/resources/launch.bat $basedir/dist/win/router/bin/
for i in linux mac win; do cp -r $basedir/import/i2p.base $basedir/dist/$i/router/; done
for i in linux mac win; do mkdir -p $basedir/dist/$i/router/i2p.config; done
echo "*** Done ***"
echo "To run, type: dist/router/bin/launch.sh"
echo "To run, type: dist/linux/router/bin/launch.sh"
+1 -1
View File
@@ -4,7 +4,7 @@ basedir=$(dirname $(dirname $(readlink -fm $0)))
cd $basedir/import
export JAVA_HOME=`realpath $basedir/import/jdk-11.0.2`
export JAVA_HOME=`realpath $basedir/import/jdks/linux/jdk-11.0.2`
# build the jars we're going to modularize
+1 -1
View File
@@ -2,7 +2,7 @@
basedir=$(dirname $(dirname $(readlink -fm $0)))
export JAVA_HOME=`realpath $basedir/import/jdk-11.0.2`
export JAVA_HOME=`realpath $basedir/import/jdks/linux/jdk-11.0.2`
jarPaths=`find $basedir/import/lib -name '*.jar'`
+11 -3
View File
@@ -7,8 +7,16 @@ cd $basedir/import
git clone https://github.com/i2p/i2p.i2p.git
wget https://download.java.net/java/GA/jdk11/7/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz
wget https://www-us.apache.org/dist//ant/binaries/apache-ant-1.10.5-bin.tar.gz
mkdir jdks
mkdir jdks/linux jdks/mac jdks/win
wget --directory-prefix=jdks/linux https://download.java.net/java/GA/jdk11/7/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz
wget --directory-prefix=jdks/mac https://download.java.net/java/GA/jdk11/7/GPL/openjdk-11.0.2_osx-x64_bin.tar.gz
wget --directory-prefix=jdks/win https://download.java.net/java/GA/jdk11/7/GPL/openjdk-11.0.2_windows-x64_bin.zip
wget https://www-us.apache.org/dist/ant/binaries/apache-ant-1.10.5-bin.tar.gz
tar zxvf jdks/linux/openjdk-11.0.2_linux-x64_bin.tar.gz -C jdks/linux/
tar zxvf jdks/mac/openjdk-11.0.2_osx-x64_bin.tar.gz -C jdks/mac/
unzip jdks/win/openjdk-11.0.2_windows-x64_bin.zip -d jdks/win/
tar zxvf openjdk-11.0.2_linux-x64_bin.tar.gz
tar zxvf apache-ant-1.10.5-bin.tar.gz
+3
View File
@@ -0,0 +1,3 @@
@echo off
set DIR=%~dp0
"%DIR%\java" -cp %DIR%\..\i2p.base\jbigi.jar -m org.getmonero.i2p.embedded --i2p.dir.base=%DIR%\..\i2p.base --i2p.dir.config=%DIR%\..\i2p.config %*