diff --git a/apps/desktopgui/build.xml b/apps/desktopgui/build.xml
index d075caccf7678c749d12e774d147f55bc93155cf..296280aba94ca362efdf88574f620e8f8d656e01 100644
--- a/apps/desktopgui/build.xml
+++ b/apps/desktopgui/build.xml
@@ -44,6 +44,7 @@
 
 	<target name="bundle" unless="no.bundle">
         <exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="${require.gettext}" >
+            <env key="JAVA_HOME" value="${java.home}" />
             <arg value="./bundle-messages.sh" />
         </exec>
         <exec executable="sh" osfamily="mac" failifexecutionfails="true" failonerror="${require.gettext}" >
diff --git a/apps/desktopgui/bundle-messages.sh b/apps/desktopgui/bundle-messages.sh
index 9dad85e5c4a594ece89811c06294c7d29ee27c5b..984a9427867bc3fb8455f8cf2be053cca5fe163c 100644
--- a/apps/desktopgui/bundle-messages.sh
+++ b/apps/desktopgui/bundle-messages.sh
@@ -16,6 +16,10 @@ TMPFILE=build/javafiles.txt
 export TZ=UTC
 RC=0
 
+if ! $(which javac); then
+    export JAVAC=${JAVA_HOME}/../bin/javac
+fi
+
 if [ "$1" = "-p" ]
 then
 	POUPDATE=1
diff --git a/apps/i2psnark/java/build.xml b/apps/i2psnark/java/build.xml
index 8e53315bb5f8b9809fe754392e85bd1025fcf754..d6a851427fab0a5a271acc5891f91c6b4c7acb72 100644
--- a/apps/i2psnark/java/build.xml
+++ b/apps/i2psnark/java/build.xml
@@ -130,6 +130,7 @@
         <!-- Update the messages_*.po files.
              We need to supply the bat file for windows, and then change the fail property to true -->
         <exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="${require.gettext}" >
+            <env key="JAVA_HOME" value="${java.home}" />
             <arg value="./bundle-messages.sh" />
         </exec>
         <exec executable="sh" osfamily="mac" failifexecutionfails="true" failonerror="${require.gettext}" >
diff --git a/apps/i2psnark/java/bundle-messages.sh b/apps/i2psnark/java/bundle-messages.sh
index 280ad7234ff47c1e3812b936b7d334e4df39ce19..bc4ad11cd9749ec46bd5447642759a968bd16398 100755
--- a/apps/i2psnark/java/bundle-messages.sh
+++ b/apps/i2psnark/java/bundle-messages.sh
@@ -15,6 +15,10 @@ TMPFILE=build/javafiles.txt
 export TZ=UTC
 RC=0
 
+if ! $(which javac]; then
+    export JAVAC=${JAVA_HOME}/../bin/javac
+fi
+
 if [ "$1" = "-p" ]
 then
 	POUPDATE=1
diff --git a/apps/i2ptunnel/java/build.xml b/apps/i2ptunnel/java/build.xml
index 76ea9e92cbb88c77d508d6a04784c671485f2008..e560018a31ceb7afe74ec6449cb2bbe7ea4e9869 100644
--- a/apps/i2ptunnel/java/build.xml
+++ b/apps/i2ptunnel/java/build.xml
@@ -92,6 +92,7 @@
         <!-- Update the messages_*.po files.
              We need to supply the bat file for windows, and then change the fail property to true -->
         <exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="${require.gettext}" >
+            <env key="JAVA_HOME" value="${java.home}" />
             <arg value="./bundle-messages.sh" />
         </exec>
         <exec executable="sh" osfamily="mac" failifexecutionfails="true" failonerror="${require.gettext}" >
diff --git a/apps/i2ptunnel/java/bundle-messages.sh b/apps/i2ptunnel/java/bundle-messages.sh
index 15d731932dd55d833b92d3522caf5673aee5605a..f4ad328a0dff40724abde600824a5e241f0fc3d6 100755
--- a/apps/i2ptunnel/java/bundle-messages.sh
+++ b/apps/i2ptunnel/java/bundle-messages.sh
@@ -14,6 +14,9 @@ CLASS=net.i2p.i2ptunnel.web.messages
 TMPFILE=build/javafiles.txt
 export TZ=UTC
 RC=0
+if ! $(which javac}; then
+    export JAVAC=${JAVA_HOME}/../bin/javac
+fi
 
 if [ "$1" = "-p" ]
 then
diff --git a/apps/routerconsole/java/build.xml b/apps/routerconsole/java/build.xml
index aedb8fc9abad6961c7dea6a2629522688cdeb4f8..497ba0955e85d6a7b690358093613ccdc85f27b0 100644
--- a/apps/routerconsole/java/build.xml
+++ b/apps/routerconsole/java/build.xml
@@ -121,6 +121,7 @@
         <!-- Update the messages_*.po files.
              We need to supply the bat file for windows, and then change the fail property to true -->
         <exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="${require.gettext}" >
+            <env key="JAVA_HOME" value="${java.home}" />
             <arg value="./bundle-messages.sh" />
         </exec>
         <exec executable="sh" osfamily="mac" failifexecutionfails="true" failonerror="${require.gettext}" >
diff --git a/apps/routerconsole/java/bundle-messages.sh b/apps/routerconsole/java/bundle-messages.sh
index 4a3aa678d7e99bf41421aabdb18b0c7b5413647e..de89fa420a2de2719d2b8cb3518aec22f0f87fad 100755
--- a/apps/routerconsole/java/bundle-messages.sh
+++ b/apps/routerconsole/java/bundle-messages.sh
@@ -15,6 +15,10 @@ TMPFILE=build/javafiles.txt
 export TZ=UTC
 RC=0
 
+if ! $(which javac); then
+    export JAVAC=${JAVA_HOME}/../bin/javac
+fi
+
 if [ "$1" = "-p" ]
 then
 	POUPDATE=1
diff --git a/apps/susidns/src/build.xml b/apps/susidns/src/build.xml
index b3677ef52234721af8bd4c70fd9ac86f93ffd3c6..ddf0bfec81c63e2fc0617cc3f275a89e8b475c41 100644
--- a/apps/susidns/src/build.xml
+++ b/apps/susidns/src/build.xml
@@ -126,6 +126,7 @@
         <!-- Update the messages_*.po files.
              We need to supply the bat file for windows, and then change the fail property to true -->
         <exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="${require.gettext}" >
+            <env key="JAVA_HOME" value="${JAVA_HOME}" />
             <arg value="./bundle-messages.sh" />
         </exec>
         <exec executable="sh" osfamily="mac" failifexecutionfails="true" failonerror="${require.gettext}" >
diff --git a/apps/susidns/src/bundle-messages.sh b/apps/susidns/src/bundle-messages.sh
index 6208d1acba0deb0eb87334f2728cd54cfd0bee17..ddbdb23fc6397c14c49c0471793b4c7b9a0656d5 100755
--- a/apps/susidns/src/bundle-messages.sh
+++ b/apps/susidns/src/bundle-messages.sh
@@ -15,6 +15,10 @@ TMPFILE=tmp/javafiles.txt
 export TZ=UTC
 RC=0
 
+if ! $(which javac]; then
+    export JAVAC=${JAVA_HOME}/../bin/javac
+fi
+
 if [ "$1" = "-p" ]
 then
 	POUPDATE=1
diff --git a/apps/susimail/build.xml b/apps/susimail/build.xml
index ad5d98fa05f9d4609d5c6df320eec15ecc2af63d..de05643fb2086d99e7bdf23e3c862fdd790994a6 100644
--- a/apps/susimail/build.xml
+++ b/apps/susimail/build.xml
@@ -80,6 +80,7 @@
         <!-- Update the messages_*.po files.
              We need to supply the bat file for windows, and then change the fail property to true -->
         <exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="${require.gettext}" >
+            <env key="JAVA_HOME" value="${java.home}" />
             <arg value="./bundle-messages.sh" />
         </exec>
         <exec executable="sh" osfamily="mac" failifexecutionfails="true" failonerror="${require.gettext}" >
diff --git a/apps/susimail/bundle-messages.sh b/apps/susimail/bundle-messages.sh
index 60646d7aa7039e31863a38deee8fa5e426a6aa52..a5ae6b729475d1d556ca25b6a98f80087336479c 100644
--- a/apps/susimail/bundle-messages.sh
+++ b/apps/susimail/bundle-messages.sh
@@ -15,6 +15,10 @@ TMPFILE=javafiles.txt
 export TZ=UTC
 RC=0
 
+if ! $(which javac); then
+    export JAVAC=${JAVA_HOME}/../bin/javac
+fi
+
 if [ "$1" = "-p" ]
 then
 	POUPDATE=1