You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by do...@apache.org on 2013/10/09 12:54:35 UTC

svn commit: r1530560 - /buildr/trunk/lib/buildr/java/rjb.rb

Author: donaldp
Date: Wed Oct  9 10:54:35 2013
New Revision: 1530560

URL: http://svn.apache.org/r1530560
Log:
Prepend the JDK bin directory to the path under windows as RJB can have issues if it picks up jvm dependencies from other products installed on the system

Modified:
    buildr/trunk/lib/buildr/java/rjb.rb

Modified: buildr/trunk/lib/buildr/java/rjb.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/java/rjb.rb?rev=1530560&r1=1530559&r2=1530560&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/java/rjb.rb (original)
+++ buildr/trunk/lib/buildr/java/rjb.rb Wed Oct  9 10:54:35 2013
@@ -112,6 +112,12 @@ module Java
       classpath.map! { |path| Proc === path ? path.call : path }
       cp = Buildr.artifacts(classpath).map(&:to_s).each { |path| file(path).invoke }
       java_opts = (ENV['JAVA_OPTS'] || ENV['JAVA_OPTIONS']).to_s.split
+
+      # Prepend the JDK bin directory to the path under windows as RJB can have issues if it picks
+      # up jvm dependencies from other products installed on the system
+      if Buildr::Util.win_os?
+        ENV["PATH"] = "#{ENV['JAVA_HOME']}#{File::SEPARATOR}bin#{File::PATH_SEPARATOR}#{ENV["PATH"]}"
+      end
       ::Rjb.load cp.join(File::PATH_SEPARATOR), java_opts
 
       props = ::Rjb.import('java.lang.System').getProperties