Skip to content

Commit d02fc06

Browse files
committed
Use the java.home property for the Java.add_to_classpath spec
* Avoids hardcoding paths of the jvm standalone.
1 parent a1af39d commit d02fc06

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spec/truffle/interop/add_to_classpath_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
describe "Java.add_to_classpath" do
1313
before :all do
1414
jar_dir = File.expand_path(File.dirname(__FILE__)) + '/fixtures/examplejar'
15-
jvm_home = TruffleRuby.graalvm_home || "#{Truffle::Boot.ruby_home}/jvm"
16-
raise "#{jvm_home} does not exist" unless Dir.exist?(jvm_home)
17-
bin_dir = "#{jvm_home}/bin"
15+
java_home = Truffle::System.get_java_property('java.home')
16+
raise "#{java_home} does not exist" unless Dir.exist?(java_home)
17+
bin_dir = "#{java_home}/bin"
1818
Dir.chdir(jar_dir) do
1919
system("#{bin_dir}/javac org/truffleruby/examplejar/Example.java")
2020
system("#{bin_dir}/jar cf example.jar org/truffleruby/examplejar/Example.class")

0 commit comments

Comments
 (0)