mirror of
https://github.com/nasa/trick.git
synced 2025-01-29 15:43:57 +00:00
parent
f412125715
commit
ba2df0757e
@ -1,11 +1,11 @@
|
||||
#!/usr/bin/perl
|
||||
package launch_java ;
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT = qw(launch_java);
|
||||
@ISA = qw(Exporter) ;
|
||||
@EXPORT = qw(launch_java) ;
|
||||
|
||||
# launch_java determines trick_home based on execution location of the calling script.
|
||||
use File::Basename ;
|
||||
use Cwd 'abs_path';
|
||||
use Cwd 'abs_path' ;
|
||||
use gte ;
|
||||
|
||||
sub launch_java($$) {
|
||||
@ -26,6 +26,10 @@ sub launch_java($$) {
|
||||
$lib_dir = "lib" ;
|
||||
}
|
||||
$java_dir = "$ENV{TRICK_HOME}/$lib_dir/trick/java" ;
|
||||
|
||||
$javac_version = `javac -version 2>&1` ;
|
||||
$javac_version =~ /(\d+)/ ;
|
||||
$javac_version = $1 ;
|
||||
|
||||
$host_cpu = gte("TRICK_HOST_CPU") ;
|
||||
chomp($host_cpu) ;
|
||||
@ -35,18 +39,23 @@ sub launch_java($$) {
|
||||
$command = "java -classpath $java_dir/dist/*:$java_dir/lib/*:$java_dir/lib/ \\
|
||||
-Xdock:name=\"$name\" \\
|
||||
-Xdock:icon=$java_dir/resources/trick_icon.png \\
|
||||
-Djava.net.preferIPv4Stack=true \\
|
||||
$application" ;
|
||||
-Djava.net.preferIPv4Stack=true \\" ;
|
||||
} else {
|
||||
$command = "java -cp $java_dir/dist/*:$java_dir/lib/*:$java_dir/lib/ $application" ;
|
||||
$command = "java -cp $java_dir/dist/*:$java_dir/lib/*:$java_dir/lib/ \\" ;
|
||||
}
|
||||
if ( ($javac_version eq "9") or ($javac_version eq "10") ) {
|
||||
$command .= "
|
||||
--add-modules java.se.ee \\" ;
|
||||
}
|
||||
$command .= "
|
||||
$application" ;
|
||||
|
||||
foreach (@ARGV) {
|
||||
$command .= " $_";
|
||||
$command .= " $_" ;
|
||||
}
|
||||
|
||||
system $command ;
|
||||
exit $? >> 8;
|
||||
exit $? >> 8 ;
|
||||
}
|
||||
|
||||
1;
|
||||
1 ;
|
||||
|
Loading…
x
Reference in New Issue
Block a user