Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Apr 2001 12:03:03 -0400
From:      "Shelton C. Johnson Jr." <shelton_c_j@yahoo.com>
To:        freebsd-java@freebsd.org
Subject:   Patch to javavmwrapper.sh to support all sym-link executables in jdk/bin
Message-ID:  <20010408120303.A70236@biturbo.digitalmagic.dnsq.org>

next in thread | raw e-mail | index | archive | help
MIME-Version: 1.0

the Java mailing list.

Hi there.  I was using your javavmwrapper and came up with an interesting
enhancement to it:


*** /usr/ports/java/javavmwrapper/src/javavmwrapper.sh	Tue Jun 20 03:40:20 2000
--- javavm	Sat Apr  7 16:50:32 2001
***************
*** 20,31 ****
  # MAINTAINER= sobomax@FreeBSD.org
  
  ARGS="${*}"
! PREFIX="%%PREFIX%%"
  CONF="${PREFIX}/etc/javavms"
  IAM=`basename "${0}"`
  
  tryrunVM () {
!     if [ -x "${1}" ]; then
          exec "${1}" ${2}
      fi
  
--- 20,34 ----
  # MAINTAINER= sobomax@FreeBSD.org
  
  ARGS="${*}"
! PREFIX="/usr/local"
  CONF="${PREFIX}/etc/javavms"
  IAM=`basename "${0}"`
  
  tryrunVM () {
!     Jhome=`dirname "${1}"`
!     if [ -x "${Jhome}/${IAM}" ]; then
! 	exec "${Jhome}/${IAM}" ${2}
!     elif [ -x "${1}" ]; then
          exec "${1}" ${2}
      fi
  


End Patch

You can ignore the PREFIX part of it for obvious reasons.  I took one extra
step in /usr/local/bin (where javavm is installed).  I used one of the
existing java installations as a template and created a set of symbolic
links to javavm which exactly mirrored the jdk/bin directory.  This lets me
have command line access to all the java tools, such as javac and jar, even
the esoteric ones.  This is useful for ports which ought to be built using
whatever jdk is installed, rather than depending on a specific one.
The script I used to create these links is:

cd /usr/local/bin
for i in ../jdk1.2.2/bin/* 
	do 
	if [ -h $i ]; then 
		k=`basename $i` 
		ln -s javavm $k 
	fi 
	done

This could be wrapped into the registerVM functionality.

Let me know what you think, I hope you find this useful enough to enhance
the javavmwrapper port.

Thanks for your useful script and all the other things you do with/for FreeBSD.


Shelton Johnson
BSD user since 386BSD 0.0

PS If the mail headers are wrong, my email address is shelton_c_j@yahoo.com


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-java" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010408120303.A70236>