[15703] in Athena Bugs
inbsd 7.7.1A: java
daemon@ATHENA.MIT.EDU (Nathan J. Williams)
Fri Nov 28 18:07:42 1997
To: bugs@MIT.EDU, 3partysw@MIT.EDU
Date: Fri, 28 Nov 1997 18:07:37 EST
From: "Nathan J. Williams" <nathanw@road-runner.mit.edu>
System name: road-runner.mit.edu
Type and version: Intel_Pentium_(P54C)_(586-class) 7.7.1A
Display type: XFree3.1_SVGA
What were you trying to do?
Run programs from the 1.1.3 JDK on a NetBSD-Athena system.
What's wrong:
There's an arch link missing, and the Linux wrapper script is
unnecessairly Linux-specific.
What should have happened:
"add java; java -ver 1.1.3" or "add java_v1.1.3; java" should work
on this system.
Please describe any relevant documentation references:
The /mit/java/README* files, vaguely.
bash(1) on a Linux-Athena system
arch(1) on a Linux-Athena system
uname(1) on a Linux-Athena and NetBSD-Athena system
Fix:
1. Add a symlink i386_nbsd1 -> i386_linux2 in /mit/java_v1.1.3/arch.
2. Apply the following patch to /mit/java_v1.1.3/distrib/i386_linux2/jdk1.1.3/bin/.java_wrapper.
This patch makes two changes: First, it avoids setting PRG, which is only used
to set up a backup value for JAVA_HOME. All of the wrapper scripts in
/mit/java/arch/i386_linux2/bin already set JAVA_HOME. The problem with setting
this value is that it uses "type -p" in the shell script, which is a bash(1)
extension to sh, and does not work on NetBSD (and there is no system-supplied
equivalent function). Second, it replaces the invocation of "`arch`" with
"`uname -m`". The "uname -m" command is equivalent to the "arch" command
on Linux-Athena systems (according to both the theory of the man page and the
empirical evidence of a current Linux-Athena system), and is more portable
(that is, NetBSD has "uname -m" but not "arch", and uname is a POSIX.2-defined
program). The question left unanswered is why this is in the script at all,
since the current Java-Linux package makes no distinction among processor
types (A guess: Because Sun did the same thing, also for no apparant reason).
*** /mit/java_v1.1.3/distrib/i386_linux2/jdk1.1.3/bin/.java_wrapper Sat Aug 16 18:59:17 1997
--- .java_wrapper Fri Nov 28 17:56:22 1997
***************
*** 8,26 ****
# Set up default variable values if not supplied by the user.
- PRG=`type -p $0` >/dev/null 2>&1
- # If PRG is a symlink, trace it to the real home directory
-
- while [ -L "$PRG" ]
- do
- newprg=`expr "\`/bin/ls -l "$PRG"\`" : ".*$PRG -> \(.*\)"`
- expr "$newprg" : / >/dev/null || newprg="`dirname $PRG`/$newprg"
- PRG="$newprg"
- done
-
- J_HOME=`dirname $PRG`/..
progname=`basename $0`
! ARCH=`arch`
# The default THREADS_TYPE is "green_threads". To change the default change
# the setting of the DEFAULT_THREADS_FLAG variable. The only valid values
--- 8,15 ----
# Set up default variable values if not supplied by the user.
progname=`basename $0`
! ARCH=`uname -m`
# The default THREADS_TYPE is "green_threads". To change the default change
# the setting of the DEFAULT_THREADS_FLAG variable. The only valid values
***************
*** 77,87 ****
*) break;
esac
done
-
- if [ -z "$JAVA_HOME" ] ; then
- export JAVA_HOME
- JAVA_HOME=$J_HOME
- fi
CLASSPATH="${CLASSPATH-.}"
if [ -z "${CLASSPATH}" ] ; then
--- 66,71 ----