Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.5.2
    • Fix Version/s: JRuby 1.6RC1
    • Component/s: Compiler
    • Labels:
      None
    • Environment:
      Windows XP SP3, 1.5.0_17, JRuby 1.5.2
    • Patch Submitted:
      Yes
    • Number of attachments :
      2

      Description

      Yesterday I built the mirah(http://www.mirah.org/) .
      I thought it was an easy task.
      However, I was encountered the following error message.

      D:\opt\mirah\mirah>jruby -S rake jar
      (in D:/opt/mirah/mirah)
      mkdir -p dist
      mkdir -p build
      Compiling Ruby sources
      Generating Java class MirahCommand to build/org/mirah/MirahCommand.java
      javac -J-Duser.language=en -d build -cp D:\opt\jruby\jruby-1.5.2/lib/jruby.jar:. build/org/mirah/MirahCommand.java
      build/org/mirah/MirahCommand.java:3: package org.jruby does not exist
      import org.jruby.Ruby;
      (snip)
      29 errors
      Compiling Mirah sources
      org/mirah/ant/compile.duby:4: Class 'org.mirah.MirahCommand' not found.
      import org.mirah.MirahCommand
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      

      I looked for the cause of this error, and found it.

      --- lib\ruby\site_ruby\shared\jruby\compiler\java_class.rb.orig	2010-08-20 14:37:58.000000000 +0900
      +++ lib\ruby\site_ruby\shared\jruby\compiler\java_class.rb	2010-08-31 12:25:25.438906800 +0900
      @@ -15,8 +15,9 @@
             jruby_jar, = ['jruby.jar', 'jruby-complete.jar'].select do |jar|
               File.exist? "#{ENV_JAVA['jruby.home']}/lib/#{jar}"
             end
      -      classpath_string = options[:classpath].size > 0 ? options[:classpath].join(":") : "."
      -      compile_string = "javac #{options[:javac_options].join(' ')} -d #{options[:target]} -cp #{ENV_JAVA['jruby.home']}/lib/#{jruby_jar}:#{classpath_string} #{files_string}"
      +      ps = ENV_JAVA['path.separator']
      +      classpath_string = options[:classpath].size > 0 ? options[:classpath].join(ps) : "."
      +      compile_string = "javac #{options[:javac_options].join(' ')} -d #{options[:target]} -cp #{ENV_JAVA['jruby.home']}/lib/#{jruby_jar}#{ps}#{classpath_string} #{files_string}"
       
             compile_string
           end
      

      JRuby::Compiler / JavaGenerator / generate_javac always was used colon character for path separator,
      But the path separator of Windows platform is semi colon.

      I made above patch file, and patched to java_class.rb .
      this patch is works fine.

      Please fix this problem.

        Activity

        Hide
        Hiro Asari added a comment -

        Hi, could you attach a git patch, please?

        Show
        Hiro Asari added a comment - Hi, could you attach a git patch, please?
        Hide
        Satoru Chinen added a comment -

        Create git patch.
        base on object e1e2babebb999c85c6cf6abc4521dfc70c011ed0

        Show
        Satoru Chinen added a comment - Create git patch. base on object e1e2babebb999c85c6cf6abc4521dfc70c011ed0
        Hide
        Satoru Chinen added a comment -

        Hi, I uploaded git patch.

        This path separator bug, was alreay fixed at #JRUBY-4990 .
        But, this changes does not completely fix the path separator bug on Windows platform.
        So, I create new patch(git patch) based on the changes of #JRUBY-4990 .

        Show
        Satoru Chinen added a comment - Hi, I uploaded git patch. This path separator bug, was alreay fixed at # JRUBY-4990 . But, this changes does not completely fix the path separator bug on Windows platform. So, I create new patch(git patch) based on the changes of # JRUBY-4990 .
        Hide
        Hiro Asari added a comment -

        Pushed to master in 5b6f587.

        Thanks, Satoru.

        Show
        Hiro Asari added a comment - Pushed to master in 5b6f587 . Thanks, Satoru.

          People

          • Assignee:
            Hiro Asari
            Reporter:
            Satoru Chinen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: