[GRADLE-1479] OS-X OpenJDK7 Issue with libjnidispatch.dylib Created: 16/Apr/11  Updated: 04/Jan/13  Resolved: 02/May/11

Status: Resolved
Project: Gradle
Affects Version/s: 1.0-milestone-2
Fix Version/s: 1.0-milestone-4

Type: Bug
Reporter: Robert Fischer Assignee: Adam Murdoch
Resolution: Fixed Votes: 1

Attachments: Text File Gradle-1479.patch    

 Description   

Something changed between Milestone 1 and Milestone 2 to cause this:

Sanctum-Sanctorium:bin robert$ gradle -version

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not locate JNA native lib resource '/com/sun/jna/darwin-universal/libjnidispatch.dylib'.
  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Milestone 1 works just fine. Now, that's almost certainly an OS-X OpenJDK 7 issue, so I marked it as "trivial", but I wanted to make people aware.



 Comments   
Comment by Glen Stampoultzis [ 27/Apr/11 ]

I've found the same thing going from mileston-1 to milestone-2 but with Solaris-i386.

$ ./gradle

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not locate JNA native lib resource '/com/sun/jna/sunos-i386/libjnidispatch.so'.
  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

$ java -version
java version "1.6.0_21"

Comment by Glen Stampoultzis [ 27/Apr/11 ]

Seems to be this library causing the problem: http://jna.java.net/

I got around this by forcing the JVM to run in 64-bit mode using the -d64 switch for Solaris. I'm not sure what the options are for OS-X.

It would be nice if this degraded gracefully. What does this Gradle use this library for?

Comment by Adam Murdoch [ 30/Apr/11 ]

Can you paste in the output of gradle -v?

Comment by Robert Fischer [ 19/May/11 ]

It's not fixed as of milestone 3. I'll try milestone 4 as soon as it's out.

I'm currently running Gradle milestone 1 (the last one that worked):
Sanctum-Sanctorium:bin robert$ gradle -v

------------------------------------------------------------
Gradle 1.0-milestone-1
------------------------------------------------------------

Gradle build time: Sunday, 27 February 2011 02:13:20 PM EST
Groovy: 1.7.8
Ant: Apache Ant(TM) version 1.8.2 compiled on December 20 2010
Ivy: 2.2.0
JVM: 1.7.0-internal (Oracle Corporation 21.0-b11)
OS: Darwin 10.7.0 universal

Here's some demonstrable failures with gradle milestone 3, even with -d64 set

Sanctum-Sanctorium:bin robert$ echo $JAVA_OPTS ; gradle -v
-server -d64 -XX:NewRatio=1 -XX:NewSize=16m -XX:+UseG1GC -XX:+ScavengeBeforeFullGC -XX:+DoEscapeAnalysis -XX:+AggressiveOpts -XX:+OptimizeStringConcat -Done-jar.verbose=false -Xmx2g

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not locate JNA native lib resource '/com/sun/jna/darwin-universal/libjnidispatch.dylib'.
  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    Sanctum-Sanctorium:bin robert$ env JAVA_OPTS="" gradle -v

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not locate JNA native lib resource '/com/sun/jna/darwin-universal/libjnidispatch.dylib'.
  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Comment by Szczepan Faber [ 07/Jun/11 ]

I heard from the reliable source that this is fixed on trunk. Can someone try the latest snapshot?

To use the latest snapshot update your wrapper properties:
distributionUrl=http\://repo.gradle.org/gradle/distributions/gradle-snapshots/gradle-1.0-milestone-4-20110605214820+0200-bin.zip

Comment by Robert Fischer [ 07/Jun/11 ]

Tried it out, and it seems to work for me:

Sanctum-Sanctorium:bin robert$ ./gradle -v

------------------------------------------------------------
Gradle 1.0-milestone-4-20110605214820+0200
------------------------------------------------------------

Gradle build time: Sunday, June 5, 2011 3:48:20 PM EDT
Groovy: 1.7.10
Ant: Apache Ant(TM) version 1.8.2 compiled on December 20 2010
Ivy: 2.2.0
JVM: 1.7.0-internal (Oracle Corporation 21.0-b14)
OS: Mac OS X 10.6.7 universal

Comment by Marc Silverboard [ 15/Jun/11 ]

We're still getting the error on gradle-1.0-milestone-4-20110610162713. AIX 5.3 ppc64, IBM Java 1.6.0 (2.4). Any suggestions, or a work-around?

root@teak:/usr/gradle/gradle-1.0-milestone-4-20110610162713+0200/bin# ls
gradle gradle.bat
root@teak:/usr/gradle/gradle-1.0-milestone-4-20110610162713+0200/bin# ./gradle -v

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not locate JNA native lib resource '/com/sun/jna/aix-ppc64/libjnidispatch.a'.
  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Comment by Shawn Ma [ 29/Jun/11 ]

Doesn't work on solaris x86 as well:
FAILURE: Build failed with an exception.

  • What went wrong:
    Could not locate JNA native lib resource '/com/sun/jna/sunos-i386/libjnidispatch.so'.
  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Comment by Jochen Hinrichsen [ 21/Jul/11 ]

I just built HEAD, same problem on AIX 6.1, IBM Java 1.6.0:

$ /applications/CDS/gradle-1.0-milestone-4-20110721150841+0200/bin/gradle -v

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not locate JNA native lib resource '/com/sun/jna/aix-ppc64/libjnidispatch.a'.
  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Comment by Jochen Hinrichsen [ 22/Jul/11 ]

Workaround for esoteric OS/ arch combinations

Comment by Jochen Hinrichsen [ 09/Sep/11 ]

Retried on milestone-5-20110908101939, still same problem.

Comment by Peter Niederwieser [ 24/Oct/11 ]

A stack trace would help. Regardless, I'm fairly certain that the problem is fixed on master, because we now have a CI build that simulates a JNA-less OS. Not sure if it's fixed in m5 though (we have done some work on this since m5).

Generated at Wed Jun 30 11:56:34 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.