Skip to content

Commit 90680fa

Browse files
committed
Use File::PATH_SEPARATOR instead of java.lang.System.getProperty.
1 parent b362c08 commit 90680fa

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Rakefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,15 @@ desc "Generate parser with ragel"
4848
task :ragel => [JAVA_PARSER_SRC]
4949

5050
if defined?(RUBY_ENGINE) and RUBY_ENGINE == 'jruby'
51-
require 'java'
52-
path_sep = java.lang.System.getProperty("path.separator")
51+
path_separator = File::PATH_SEPARATOR
5352
ENV['JAVA_HOME'] ||= [
5453
'/usr/local/java/jdk',
5554
'/usr/lib/jvm/java-6-openjdk',
5655
'/Library/Java/Home',
5756
].find { |c| File.directory?(c) }
5857
if ENV['JAVA_HOME']
5958
warn " *** JAVA_HOME is set to #{ENV['JAVA_HOME'].inspect}"
60-
ENV['PATH'] = ENV['PATH'].split(/path_sep/).unshift(java_path = "#{ENV['JAVA_HOME']}/bin") * path_sep
59+
ENV['PATH'] = ENV['PATH'].split(/path_separator/).unshift(java_path = "#{ENV['JAVA_HOME']}/bin") * path_separator
6160
warn " *** java binaries are assumed to be in #{java_path.inspect}"
6261
else
6362
warn " *** JAVA_HOME was not set or could not be guessed!"
@@ -67,7 +66,7 @@ if defined?(RUBY_ENGINE) and RUBY_ENGINE == 'jruby'
6766
JRUBY_JAR = File.join(CONFIG["libdir"], "jruby.jar")
6867
if File.exist?(JRUBY_JAR)
6968
JAVA_SOURCES.each do |src|
70-
classpath = (Dir['java/lib/*.jar'] << 'java/src' << JRUBY_JAR) * path_sep
69+
classpath = (Dir['java/lib/*.jar'] << 'java/src' << JRUBY_JAR) * path_separator
7170
obj = src.sub(/\.java\Z/, '.class')
7271
file obj => src do
7372
sh 'javac', '-classpath', classpath, '-source', '1.8', '-target', '1.8', src

0 commit comments

Comments
 (0)