Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-2729

Gremlin Console fails to start on ARM Mac with ARM Java

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 3.5.2
    • None
    • console
    • None

    Description

      Trying to use Gremlin Console with Java 18 on an M1 Mac throws a no jansi in java.library.path error, similar to https://issues.apache.org/jira/browse/TINKERPOP-2584. This happens with both Oracle and OpenJDK.

      Notably ARM OpenJDK 18 is what you currently get when you brew install java on a new Mac, so that's probably what most users will have.

      Here's a sample project to repro this on an M1 Mac:

      https://github.com/jrr/gremlin-console-jvms

       

      jrr@jrrmbp ~/r/gremlin-console-jvms (main)> make test_openjdk_18_arm 
      (...)
      file `which java`
      /Users/jrr/repos/gremlin-console-jvms/.jdks/openjdk_18_arm/jdk-18.jdk/Contents/Home/bin/java: Mach-O 64-bit executable arm64
      java -version
      openjdk version "18" 2022-03-22
      OpenJDK Runtime Environment (build 18+36-2087)
      OpenJDK 64-Bit Server VM (build 18+36-2087, mixed mode, sharing)
      (...)
      .gremlin-console/apache-tinkerpop-gremlin-console/bin/gremlin.sh
      Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load library. Reasons: [no jansi in java.library.path: /Users/jrr/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:., Can't load library: /var/folders/f1/5hh6j9fd7mv6dm1hdrzzh7_w0000gn/T/libjansi-64-9334025133467737627.jnilib]
          at org.fusesource.hawtjni.runtime.Library.doLoad(Library.java:182)
          at org.fusesource.hawtjni.runtime.Library.load(Library.java:140)
          at org.fusesource.jansi.internal.CLibrary.<clinit>(CLibrary.java:42)
          at org.fusesource.jansi.AnsiConsole.wrapOutputStream(AnsiConsole.java:48)
          at org.fusesource.jansi.AnsiConsole.<clinit>(AnsiConsole.java:38)
          at java.base/java.lang.Class.forName0(Native Method)
          at java.base/java.lang.Class.forName(Class.java:488)
          at java.base/java.lang.Class.forName(Class.java:467)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray$1.run(CallSiteArray.java:67)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray$1.run(CallSiteArray.java:64)
          at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallStaticSite(CallSiteArray.java:64)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:161)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:119)
          at org.apache.tinkerpop.gremlin.console.Colorizer.installAnsi(Colorizer.groovy:32)
          at org.apache.tinkerpop.gremlin.console.Colorizer$installAnsi.call(Unknown Source)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:119)
          at org.apache.tinkerpop.gremlin.console.Console.<clinit>(Console.groovy:61)
      make[1]: *** [gremlin-console] Error 1
      make: *** [test_openjdk_18_arm] Error 2 

      Attachments

        Issue Links

          Activity

            People

              colebq Cole Greer
              jrrrr John Ruble
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: