The new javavmwrapper and PATH

Greg Lewis glewis at eyesbeyond.com
Thu Nov 11 20:02:36 PST 2004


On Fri, Nov 12, 2004 at 12:09:49AM +0100, Christian Laursen wrote:
> I just upgraded to the new javavmwrapper and noticed that one of my java
> programs stopped working.
> 
> It runs binaries usually in the path but javavmwrapper sets the path to
> "/bin:/sbin:/usr/bin:/usr/sbin".
> 
> Shouldn't $LOCALBASE/bin and $LOCALBASE/sbin be part of the path as well?
> 
> Or would it perhaps be better to set the original path back before starting
> the chosen java binary?

Does the attached diff fix this for you?

-- 
Greg Lewis                          Email   : glewis at eyesbeyond.com
Eyes Beyond                         Web     : http://www.eyesbeyond.com
Information Technology              FreeBSD : glewis at FreeBSD.org
-------------- next part --------------
Index: src/javavmwrapper.sh
===================================================================
RCS file: /home/pcvs/ports/java/javavmwrapper/src/javavmwrapper.sh,v
retrieving revision 1.8
diff -u -r1.8 javavmwrapper.sh
--- src/javavmwrapper.sh	11 Nov 2004 19:17:37 -0000	1.8
+++ src/javavmwrapper.sh	12 Nov 2004 04:01:31 -0000
@@ -29,6 +29,7 @@
 #
 # MAINTAINER=java at FreeBSD.org
 
+OLD_PATH=${PATH}
 export PATH=/bin:/sbin:/usr/bin:/usr/sbin
 
 PREFIX="%%PREFIX%%"
@@ -42,6 +43,9 @@
 tryJavaCommand () {
     # Check for the command being executable and exec it if so.
     if [ -x "${1}" ]; then
+        if [ ! -z "${OLD_PATH}" ]; then
+            export PATH=${OLD_PATH}
+        fi
         exec "${@}"
     fi
 


More information about the freebsd-java mailing list