Find java in our path instead of requiring JAVA_HOME be set.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5419 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
+2
-24
@@ -12,28 +12,6 @@ chomp($location = `dirname $0`);
|
||||
pop(@parts);
|
||||
my $root = join("/", @parts);
|
||||
|
||||
my $jhome = $ENV{"JAVA_HOME"};
|
||||
|
||||
# make sure JAVA_HOME is set
|
||||
if (!defined $jhome) {
|
||||
warn "$0: Error: No JAVA_HOME specified!\n";
|
||||
warn "\n";
|
||||
warn "You must set your JAVA_HOME environment variable to the\n";
|
||||
warn "the absolute path of your JDK installation. For example:\n";
|
||||
warn "\n";
|
||||
warn " % JAVA_HOME=/usr/local/jdk1.2\n";
|
||||
warn " % export JAVA_HOME\n";
|
||||
die "\n";
|
||||
}
|
||||
|
||||
# make sure it's set to a directory
|
||||
if (! -d $jhome) {
|
||||
die "$0: Can't find a java interpreter in '$jhome'.\n";
|
||||
}
|
||||
|
||||
my $java = "$jhome/bin/java";
|
||||
my $jlib = "$jhome/lib/classes.zip";
|
||||
|
||||
# determine our machine architecture
|
||||
my $ostype = `uname -s`;
|
||||
my $machtype = `uname -m`;
|
||||
@@ -67,7 +45,7 @@ foreach $dir (@dirs) {
|
||||
}
|
||||
|
||||
# finally add the standard classes
|
||||
$classpath = "$classpath:$jlib";
|
||||
$classpath = "$classpath";
|
||||
|
||||
# specify our resource root (the resource manager needs this)
|
||||
my $rootarg = "-Dresource_dir=$root/tests/rsrc";
|
||||
@@ -102,6 +80,6 @@ for ($i = 0; $i < @ARGV; $i++) {
|
||||
# log the pid file if requested to do so
|
||||
print `echo $$ > $pid_file` if (defined $pid_file);
|
||||
|
||||
my $cmd = "$java -mx256M $classpath $rootarg " . join(" ", @ARGV);
|
||||
my $cmd = "java -mx256M $classpath $rootarg " . join(" ", @ARGV);
|
||||
# print "$cmd\n";
|
||||
exec($cmd);
|
||||
|
||||
Reference in New Issue
Block a user