From 40013948c2e4e58af1160650eb28a525bb4b00e6 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Wed, 16 Jan 2002 00:41:52 +0000 Subject: [PATCH] Look in JAVA_LIBS for the system-wide java libraries rather than hard coding the path to /usr/share/java. This allows us to set JAVA_LIBS to the path to yolibs when building and running Narya code. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@858 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- bin/runjava | 3 ++- tests/bin/runjava | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/runjava b/bin/runjava index 8697f4fb0..b59686b4e 100755 --- a/bin/runjava +++ b/bin/runjava @@ -55,8 +55,9 @@ if (defined $libpath) { my $classpath = "-classpath $root/dist/classes"; # add zip and jar files from our lib/ directory and the system lib/ directory -my @dirs = ( "$root/lib", "/usr/share/java" ); +my @dirs = ( "$root/lib", $ENV{"JAVA_LIBS"} ); foreach $dir (@dirs) { + next unless (defined $dir); if (opendir(DIR, $dir)) { foreach $lib (grep { /.(zip|jar)/ && -f "$dir/$_" } readdir(DIR)) { $classpath .= ":$dir/$lib"; diff --git a/tests/bin/runjava b/tests/bin/runjava index 07c4fd0b5..4209d264d 100755 --- a/tests/bin/runjava +++ b/tests/bin/runjava @@ -57,9 +57,11 @@ if (defined $libpath) { # put everything in our class path my $classpath = "-classpath $root/tests/dist/classes:$root/dist/classes"; -# add zip and jar files from our lib/ directory and the system lib/ directory -my @dirs = ( "$root/lib", "/usr/share/java" ); +# add zip and jar files from our lib/ directory and the global Java +# libraries directory +my @dirs = ( "$root/lib", $ENV{"JAVA_LIBS"} ); foreach $dir (@dirs) { + next unless (defined $dir); if (opendir(DIR, $dir)) { foreach $lib (grep { /.(zip|jar)/ && -f "$dir/$_" } readdir(DIR)) { $classpath .= ":$dir/$lib";