Skip to content

Commit 2b40141

Browse files
committed
[GR-47035] JT: look at ruby_home/release if no graalvm_home
PullRequest: truffleruby/3911
2 parents 2fa7c4b + d02fc06 commit 2b40141

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

spec/truffle/interop/add_to_classpath_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +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-
bin_dir = TruffleRuby.graalvm_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"
1618
Dir.chdir(jar_dir) do
1719
system("#{bin_dir}/javac org/truffleruby/examplejar/Example.java")
1820
system("#{bin_dir}/jar cf example.jar org/truffleruby/examplejar/Example.class")

tool/jt.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ def truffleruby_compiler?
331331
return @truffleruby_compiler = true if truffleruby_native_built?
332332

333333
# Detect if the compiler is present by reading the $graalvm_home/release file
334-
@truffleruby_compiler = File.readlines("#{graalvm_home}/release").grep(/^COMMIT_INFO=/).any? do |line|
334+
@truffleruby_compiler = File.readlines("#{graalvm_home || ruby_home}/release").grep(/^COMMIT_INFO=/).any? do |line|
335335
line.include?('"compiler":') || line.include?("'compiler':")
336336
end
337337
end

0 commit comments

Comments
 (0)