Groovy Modules
  1. Groovy Modules
  2. GMOD-222

Does not work with 64-bit JVM on Windows

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Native Launcher
    • Labels:
      None
    • Environment:
      win7/64-bit with 64-bit Java 1.6.0_14
    • Number of attachments :
      0

      Description

      For example:

      C:\Users\Bob\Desktop\Groovy Native Launcher>groovy test.groovy
      error: dynamic library C:\PROGRA~1\Java\jdk1.6.0_14\jre\bin\server\jvm.dll exists but could not be loaded!
      error (win code 193): (null)
      error: could not find client or server jvm under C:\PROGRA~1\Java\jdk1.6.0_14
             please check that it is a valid jdk / jre containing the desired type of jvm
      
      C:\Users\Bob\Desktop\Groovy Native Launcher>groovy -h
      error: dynamic library C:\PROGRA~1\Java\jdk1.6.0_14\jre\bin\server\jvm.dll exists but could not be loaded!
      error (win code 193): (null)
      error: could not find client or server jvm under C:\PROGRA~1\Java\jdk1.6.0_14
             please check that it is a valid jdk / jre containing the desired type of jvm
      
       -jh,--javahome <path to jdk/jre> makes groovy use the given jdk/jre
                                       instead of the one pointed to by JAVA_HOME
       --conf <conf file>              use the given groovy conf file
      
       -cp,-classpath,--classpath <user classpath>
                                       the classpath to use
       -client/-server                 to use a client/server VM
      
      In addition, you can give any parameters accepted by the jvm you are using, e.g.
      
      -Xmx<size> (see java -help and java -X for details)
      
      
      C:\Users\Bob\Desktop\Groovy Native Launcher>
      

        Activity

        Hide
        Russel Winder added a comment -

        Basically the dlopen call (jvmstarter.c:438) is failing for whatever reason.

        Show
        Russel Winder added a comment - Basically the dlopen call (jvmstarter.c:438) is failing for whatever reason.
        Hide
        blackdrag blackdrag added a comment -

        this is no 32bit-Application tries to open 64bit-DLL problem?

        Show
        blackdrag blackdrag added a comment - this is no 32bit-Application tries to open 64bit-DLL problem?
        Hide
        Antti Karanta added a comment -

        Yes, this is obviously a 32 bit executable trying to load a 64 bit dll (and failing).

        There is no 64 bit support on the native launcher yet as scons (our build tool) and mingw gcc are both in progress in their 64 bit support.

        It is possible to compile a 64-bit native launcher binary if Visual Studio 2008 is installed. Run the scons build, copy paste the output parts that show the commands that were run, make it into a .bat file and run that in Visual Studio Tools -> Visual Studio x64 Cross Tools Command Prompt (from the Visual Studio program group in All Programs).
        I did that a while back when this was discussed on the groovy mailing list, but then there was nobody who would have tried out the produced binary so I don't know for sure whether it really worked. :/

        So, on 64 bit windows you have to either use 32 bit jvm or use groovy.bat to launch your scripts. Or try rolling your own native launcher binary as described above.

        Show
        Antti Karanta added a comment - Yes, this is obviously a 32 bit executable trying to load a 64 bit dll (and failing). There is no 64 bit support on the native launcher yet as scons (our build tool) and mingw gcc are both in progress in their 64 bit support. It is possible to compile a 64-bit native launcher binary if Visual Studio 2008 is installed. Run the scons build, copy paste the output parts that show the commands that were run, make it into a .bat file and run that in Visual Studio Tools -> Visual Studio x64 Cross Tools Command Prompt (from the Visual Studio program group in All Programs). I did that a while back when this was discussed on the groovy mailing list, but then there was nobody who would have tried out the produced binary so I don't know for sure whether it really worked. :/ So, on 64 bit windows you have to either use 32 bit jvm or use groovy.bat to launch your scripts. Or try rolling your own native launcher binary as described above.
        Hide
        Antti Karanta added a comment -

        I just looked up the error code 193 (displayed in the error message):

        #define ERROR_BAD_EXE_FORMAT 193L

        which just ascertains that this is 32 vs. 64 bit binary issue. Or the jvm.dll is corrupted, but that seems more unlikely.

        Show
        Antti Karanta added a comment - I just looked up the error code 193 (displayed in the error message): #define ERROR_BAD_EXE_FORMAT 193L which just ascertains that this is 32 vs. 64 bit binary issue. Or the jvm.dll is corrupted, but that seems more unlikely.
        Hide
        Russel Winder added a comment -

        I just wanted to point out that:

        There is no 64 bit support on the native launcher yet as scons (our build tool) and mingw gcc are both in progress in their 64 bit support.

        may apply to Windows, but it does not apply to Solaris, Mac OS X and Ubuntu. 64-bit native launcher support works fine on those platforms.

        Show
        Russel Winder added a comment - I just wanted to point out that: There is no 64 bit support on the native launcher yet as scons (our build tool) and mingw gcc are both in progress in their 64 bit support. may apply to Windows, but it does not apply to Solaris, Mac OS X and Ubuntu. 64-bit native launcher support works fine on those platforms.
        Hide
        Ivan Sobolev added a comment -

        Workaround: drop all your *.exe files from %GROOVY_HOME%/bin folder - *.bat seem to work ok.

        _________________________________________________________________________________________
        http://groovy.329449.n5.nabble.com/jvm-dll-exists-but-could-not-be-loaded-td361221.html

        Show
        Ivan Sobolev added a comment - Workaround: drop all your *.exe files from %GROOVY_HOME%/bin folder - *.bat seem to work ok. _________________________________________________________________________________________ http://groovy.329449.n5.nabble.com/jvm-dll-exists-but-could-not-be-loaded-td361221.html
        Hide
        Antti Karanta added a comment -

        Sorry, for some reason this issue has been left hanging around. There has been both 32 and 64 bit native launchers for groovy for some years now. I think the installer determines which one to install based on whether you have 32 or 64 bit jvm.

        If you try to use 32 bit native launcher with 64 bit jvm or vice versa you will get an error telling you so. In that case you should later your path so that your groovy launcher and jvm are both 32 or 64 bit versions.

        Show
        Antti Karanta added a comment - Sorry, for some reason this issue has been left hanging around. There has been both 32 and 64 bit native launchers for groovy for some years now. I think the installer determines which one to install based on whether you have 32 or 64 bit jvm. If you try to use 32 bit native launcher with 64 bit jvm or vice versa you will get an error telling you so. In that case you should later your path so that your groovy launcher and jvm are both 32 or 64 bit versions.
        Hide
        Paul King added a comment -

        I believe there are still existing issues on windows. I think in general both 32bit and 64bit versions of the JVM can be assumed to be around, so picking just on exe to install seems not to be a viable approach - but I will play a bit more when I get a chance and comment further. IDEA seems to provide both a 32bit and 64bit executable. I wonder if this is not viable?

        Show
        Paul King added a comment - I believe there are still existing issues on windows. I think in general both 32bit and 64bit versions of the JVM can be assumed to be around, so picking just on exe to install seems not to be a viable approach - but I will play a bit more when I get a chance and comment further. IDEA seems to provide both a 32bit and 64bit executable. I wonder if this is not viable?
        Hide
        Antti Karanta added a comment -

        The installer contains both 32 and 64 bit executables so naturally they could both be installed e.g. in bin and bin64 folders in the groovy installation dir. This still leaves us with with the problem of which ones to put onto the PATH.

        Anyhow, this is not an issue with the native launcher per se but on how it is deployed by the installer so maybe this issue should be assigned to Joachim Bauman who makes the installer?

        If you find issues with the 64-bit (or 32-bit) native launcher on windows or any other platform, let me know.

        As the installer currently (AFAIK) only installs the 32 or 64 bit binaries you can either compile your own or download precompiled ones from the native launcher wiki page: http://docs.codehaus.org/display/GROOVY/Native+Launcher -> Tools (on the top right) -> Attachments

        Show
        Antti Karanta added a comment - The installer contains both 32 and 64 bit executables so naturally they could both be installed e.g. in bin and bin64 folders in the groovy installation dir. This still leaves us with with the problem of which ones to put onto the PATH. Anyhow, this is not an issue with the native launcher per se but on how it is deployed by the installer so maybe this issue should be assigned to Joachim Bauman who makes the installer? If you find issues with the 64-bit (or 32-bit) native launcher on windows or any other platform, let me know. As the installer currently (AFAIK) only installs the 32 or 64 bit binaries you can either compile your own or download precompiled ones from the native launcher wiki page: http://docs.codehaus.org/display/GROOVY/Native+Launcher -> Tools (on the top right) -> Attachments

          People

          • Assignee:
            Antti Karanta
            Reporter:
            alpheratz
          • Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: