diff --git a/core/c/jbigi/build.sh b/core/c/jbigi/build.sh
index 535e451f5286c03a1ea2a6c83fb30ae4ee629517..e5d4ae40305a8e5cedb51e34258a7f1b5d939621 100755
--- a/core/c/jbigi/build.sh
+++ b/core/c/jbigi/build.sh
@@ -17,6 +17,8 @@ mkdir -p lib/
 mkdir -p bin/local
 VER=4.3.1
 
+set -e
+
 if [ "$1" != "dynamic" -a ! -d gmp-$VER ]
 then
 	TAR=gmp-$VER.tar.lzma
@@ -54,10 +56,13 @@ cp *jbigi???* ../../lib/
 echo 'Library copied to lib/'
 cd ../..
 
-I2P=~i2p
 if [ ! -f $I2P/lib/i2p.jar ]
 then
-	echo "I2P installation not found in $I2P - correct \$I2P definition in script to run speed test"
+	echo "I2P installation not found"
+    echo "We looked in '$I2P'"
+    echo "Not running tests against I2P installation without knowing where it is"
+    echo "Please set the environment variable I2P to the location of your I2P installation (so that \$I2P/lib/i2p.jar works)"
+    echo "If you do so, this script will run two tests to compare your installed jbigi with the one here you just compiled (to see if there is a marked improvement)"
 	exit 1
 fi
 echo 'Running test with standard I2P installation...'
@@ -65,3 +70,5 @@ java -cp $I2P/lib/i2p.jar:$I2P/lib/jbigi.jar net.i2p.util.NativeBigInteger
 echo
 echo 'Running test with new libjbigi...'
 java -Djava.library.path=lib/ -cp $I2P/lib/i2p.jar:$I2P/lib/jbigi.jar net.i2p.util.NativeBigInteger
+echo 'If the second is better performance, please use the jbigi you have compiled i2p will work better!'
+echo '(You can do that just by copying lib/libjbigi.so over the existing libjbigi.so file in $I2P)'
diff --git a/core/c/jbigi/build_jbigi.sh b/core/c/jbigi/build_jbigi.sh
index 8ff3219b8a0d7863b5da2478fe9bd79424c51824..48562012a09bd9de14796b3b2991e70a8b8a0a50 100755
--- a/core/c/jbigi/build_jbigi.sh
+++ b/core/c/jbigi/build_jbigi.sh
@@ -31,6 +31,12 @@ Darwin*)
 	LIBFILE="libjbigi.so";;
 esac
 
+if [ ! -f "$JAVA_HOME/include/jni.h" ]; then
+    echo "Cannot find jni.h! Looked in '$JAVA_HOME/include/jni.h'"
+    echo "Please set JAVA_HOME to a java home that has the JNI"
+    exit 1
+fi
+
 #To link dynamically to GMP (use libgmp.so or gmp.lib), uncomment the first line below
 #To link statically to GMP, uncomment the second line below
 # Bug!!! Quote *BOTH* or neither! --Sponge