eclipse-openj9 / openj9

Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput. Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.
Other
3.27k stars 721 forks source link

can't run Eclipse itself using jdk11+28 on macOS #3371

Open martinlippert opened 5 years ago

martinlippert commented 5 years ago

Tried to run Eclipse using OpenJDK 11 with J9 on macOS (jdk11+28), but it fails with a message: "Failed to create Java Virtual Machine"

Specified the J9 VM in the ini file using "-vm" option, as usual.

DanHeidinga commented 5 years ago

@pdbain-ibm Can you take a look at this?

pdbain-ibm commented 5 years ago

Will do.

pdbain-ibm commented 5 years ago

Downloaded eclipse-java-2018-09-macosx-cocoa-x86_64.dmg. Tested with -vm set to an OpenJDK JDK:

$ ./jdk-11+28/Contents/Home/bin/java -version
openjdk version "11" 2018-09-25
OpenJDK Runtime Environment AdoptOpenJDK (build 11+28)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11+28, mixed mode)

The IDE launches.

Testing with a recent OpenJ9 build, I get the same message.

We can launch using Eclipse.app/Contents/MacOS/eclipse.

Running with OpenJDK Java 11:

org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized.  Will retry after the state location is initialized.
org.eclipse.m2e.logback.configuration: Logback config file: /Users/pdbain/macprojects/eclipse/workspace/.metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.1.9.1.20180912-1601.xml
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [bundleresource://512.fwk62156248:1/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [bundleresource://512.fwk62156248:2/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
org.eclipse.m2e.logback.configuration: Initializing logback

Running with OpenJ9: JVMJ9VM015W Initialization error for library j9gc29(2): Failed to instantiate compressed references metadata; 200M requested.

pdbain-ibm commented 5 years ago

@babsingh: @charliegracie thinks you may have some insight into this. I am building a non-compressedrefs JDK to test his hypothesis.

pdbain-ibm commented 5 years ago

Having trouble building non-compressedrefs: https://github.com/eclipse/openj9/issues/3382.

babsingh commented 5 years ago

JVMJ9VM015W Initialization error for library j9gc29(2): Failed to instantiate compressed references metadata; 200M requested

I saw the same error when building OpenJ9 compressedrefs; javac didn't run to build the JDK tools. Memory wasn't being allocated below 4GB. This issue was fixed via https://github.com/ibmruntimes/openj9-openjdk-jdk11/pull/35 and https://github.com/eclipse/omr/pull/3045. -pagezero_size 0x1000 was appended to LDFLAGS_JDKEXE. -pagezero_size is only applied when generating executables (java, javac, ...). Also, an OMR memory allocation function was enabled for OSX.

It may not be the same issue this time since java -version, javac -version and other Java tests run. Something else may be failing during GC initialization.

fyi @pdbain-ibm

JasonFengJ9 commented 5 years ago

@martinlippert were you able to launch Eclipse with an OpenJDK JDK11 by any chance?

Ignore that, Java 11 Support for Eclipse 2018-09 (4.9)

martinlippert commented 5 years ago

That link points to the Java 11 language support in Eclipse, it has nothing to do with running the IDE itself using a JDK 11.

And yes, I can run my IDE using the OpenJDK 11 with Hotspot latest nightly build.

pdbain-ibm commented 5 years ago

Successfully built OpenJ9 Java 11 (full 64 bit). I get a splash screen, then a message: No Java runtime present, requesting install.

babsingh commented 5 years ago

Guess - ./eclipse executable is used to launch the Eclipse IDE. I don't think the ./eclipse executable is created using -pagezero_size 0x1000 (linker flag). This prevents memory to be allocated below 4GB. Memory allocation below 4GB seems to be a property of the parent executable. Even though java executable is created with -pagezero_size 0x1000, the parent executable ./eclipse, which invokes java, is not created with this linker flag. Giving rise to ... JVMJ9VM015W Initialization error for library j9gc29(2): Failed to instantiate compressed references metadata; 200M requested. Eclipse needs to be rebuilt using -pagezero_size 0x1000 to verify this hypothesis.

is anyone familiar with building Eclipse?

fyi @pdbain-ibm @pshipton @DanHeidinga @JasonFengJ9

JasonFengJ9 commented 5 years ago

Thanks for confirmation. Just to clarify, running JDK11 with an older Eclipse version (such as Oxygen 4.7) might hit following exceptions:

java.lang.NoClassDefFoundError: javax.annotation.PreDestroy
        at org.eclipse.e4.core.internal.di.InjectorImpl.disposed(InjectorImpl.java:450)
        at org.eclipse.e4.core.internal.di.Requestor.disposed(Requestor.java:156)
        at org.eclipse.e4.core.internal.contexts.ContextObjectSupplier$ContextInjectionListener.update(ContextObjectSupplier.java:78)
        at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:111)
        at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.handleInvalid(TrackableComputationExt.java:74)
        at org.eclipse.e4.core.internal.contexts.EclipseContext.dispose(EclipseContext.java:178)
        at org.eclipse.e4.core.internal.contexts.osgi.EclipseContextOSGi.dispose(EclipseContextOSGi.java:99)
        at org.eclipse.e4.core.internal.contexts.osgi.EclipseContextOSGi.bundleChanged(EclipseContextOSGi.java:141)
        at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:908)
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
        at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
        at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:213)
        at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:120)
        at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:112)
        at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:168)
        at org.eclipse.osgi.container.Module.publishEvent(Module.java:476)
        at org.eclipse.osgi.container.Module.doStop(Module.java:634)
        at org.eclipse.osgi.container.Module.stop(Module.java:498)
        at org.eclipse.osgi.container.SystemModule.stop(SystemModule.java:202)
        at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule$1.run(EquinoxBundle.java:165)
        at java.base/java.lang.Thread.run(Thread.java:825)
Caused by: java.lang.ClassNotFoundException: javax.annotation.PreDestroy cannot be found by org.eclipse.e4.core.di_1.6.100.v20170421-1418
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:433)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387)
        at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:1032)
        ... 21 more

This is because javax.annotation doesn't present in JDK11 default modules any more. That link provides a confirmation that Eclipse 4.9 does work with JDK11.

JasonFengJ9 commented 5 years ago

@babsingh the theory can be verified via a native application compiled and linked without -pagezero_size 0x1000, this app just launches an OpenJ9 -version. If the guess is right, -version won't succeed.

babsingh commented 5 years ago

Thanks, @JasonFengJ9. I am creating a native app (with and without -pagezero_size 0x1000). It will invoke/wrap a call to java compressedrefs to verify my hypothesis.

pdbain-ibm commented 5 years ago

Eclipse wants a full MacOS JVM with all the trimmings: a standard JAVA_HOME will cause an error about Java not being installed.

I downloaded a MacOS full build from AdoptOpenJDK https://github-production-release-asset-2e65be.s3.amazonaws.com/140419044/94703080-d53a-11e8-914d-3abd5d8402c1?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20181023%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20181023T133928Z&X-Amz-Expires=300&X-Amz-Signature=2167cc37da94db686347274b65d2420f1f1963d01c7922fa0417d4e7865520e0&X-Amz-SignedHeaders=host&actor_id=18007966&response-content-disposition=attachment%3B%20filename%3DOpenJDK11-jdk_x64_mac_openj9_11.0.1_13.tar.gz&response-content-type=application%2Foctet-stream https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.1%2B13/OpenJDK11-jdk_x64_mac_openj9_11.0.1_13.tar.gz, deleted Contents/Home/* and replaced it with build/macosx-x86_64-normal-server-release/images/jdk/* from a non-compressedrefs build.

The IDE launches. I can create and run HelloWorld.java.

Next steps:

  1. Figure out the problem with compressedrefs
  2. Start building full MacOS JREs.
babsingh commented 5 years ago

Observations for compressedrefs: 1) Native applications which call java via the system function work fine. 2) Native applications which invoke the JVM using JNI after linking to the shared libraries such as libjvm.dylib need -pagezero_size 0x1000. Otherwise, Initialization error for library j9gc29(2) will be encountered. 3) Got further by launching Eclipse using the JAR file: java -XstartOnFirstThread -jar /Applications/eclipse/plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar. OpenJ9 JDK11 compressedrefs didn't encounter the Initialization error for library j9gc29(2). But, hit the same error as before related to org.eclipse.m2e.logback.configuration: Initializing logback. As Peter mentioned above, using a full MacOS JVM may fix this issue. Not sure if there will be other issues related to directly using the JAR file.

To use the ./eclipse executable with OpenJ9 compressedrefs on OSX, it will need to be rebuilt with -pagezero_size 0x1000.

charliegracie commented 5 years ago

Why does OpenJDK with hotspot, which defaults to compressed references, work with the same eclipse executable?

pdbain-ibm commented 5 years ago

Further to https://github.com/eclipse/openj9/issues/3371#issuecomment-432269446

Start building full MacOS JREs.

Use build/macosx-x86_64-normal-server-release/images/jdk-bundle/jdk-11.0.1.jdk/Contents/Home/bin/java

pdbain-ibm commented 5 years ago

About https://github.com/eclipse/openj9/issues/3371#issuecomment-432291933

Native applications which invoke the JVM using JNI after linking to the shared libraries such as libjvm.dylib need -pagezero_size 0x1000.

This will be an issue with any custom Java launcher, right?

@babsingh could you try your native launcher (with the default pagezero_size) with Hotspot?

pdbain-ibm commented 5 years ago

@AdamBrousseau would it be possible to add MacOS Large Heap (alias non-compressedrefs) builds to AdoptOpenJDK so users can run Eclipse?

AdamBrousseau commented 5 years ago

add MacOS Large Heap builds to Adopt

I assume it could be easily added. I would recommend opening an issue at AdoptOpenJDK-Build. I think Stewart is trying to get 8 working atm (https://github.com/AdoptOpenJDK/openjdk-build/issues/683).

pdbain-ibm commented 5 years ago

As a workaround for the present issue, I have requested large heap builds on AdoptOpenJDK: https://github.com/AdoptOpenJDK/openjdk-build/issues/686.

babsingh commented 5 years ago

could you try your native launcher (with the default pagezero_size) with Hotspot?

@pdbain-ibm OpenJDK works regardless of -pagezero_size,0x1000 being specified. OpenJ9 compressedrefs experiences Initialization error for library j9gc29(2) in the absence of -pagezero_size,0x1000.

Compiling native app (using Java 8):

OpenJ9:
gcc -o main -I ${JAVA_HOME}/include/ -I ${JAVA_HOME}/include/darwin/ -ldl main.c ${JAVA_HOME}/jre/lib/compressedrefs/libjvm.dylib -Wl,-rpath,${JAVA_HOME}/jre/lib/compressedrefs,-pagezero_size,0x1000

Hotspot:
gcc -o main -I ${JAVA_HOME}/include/ -I ${JAVA_HOME}/include/darwin/ -ldl main.c ${JAVA_HOME}/jre/lib/server/libjvm.dylib -Wl,-rpath,${JAVA_HOME}/jre/lib/server,-pagezero_size,0x1000

Why does OpenJDK with hotspot, which defaults to compressed references, work with the same eclipse executable?

@charliegracie not sure why Hotspot works. Guess: it may have a fail safe if memory allocation below 4GB fails. In OMR context: if allocate_memory32 fails, then use malloc.

On 64-bit OSX, pagezero size is the lower 4GB by default; this is an unreadable segment created by the linker. I think the pagezero size can't be defined dynamically, and it can only be specified while building as a linker flag for executables.

pdbain-ibm commented 5 years ago

@babsingh would you kindly attach your main.c?

@charliegracie @dmitripivkine does the compressed references metadata need to be below the 32-bit bar?

dmitripivkine commented 5 years ago

@babsingh would you kindly attach your main.c?

@charliegracie @dmitripivkine does the compressed references metadata need to be below the 32-bit bar?

Current implementation required some VM metadata (j9classes, j9vmthreads etc) to be allocated below 4G bar.

babsingh commented 5 years ago

@pdbain-ibm main.c:

#include <jni.h>

int main(int argc, char **argv)
{
    JavaVM         *vm;
    JNIEnv         *env;
    JavaVMInitArgs  vm_args;
    jint            res;
    jclass          cls;
    jmethodID       mid;
    jstring         jstr;
    jobjectArray    main_args;
    JavaVMOption    options;

    vm_args.version  = JNI_VERSION_1_8;
    vm_args.nOptions = 1;
    options.optionString = "-Xcompressedrefs";
    vm_args.options = &options;
    res = JNI_CreateJavaVM(&vm, (void **)&env, &vm_args);
    if (res != JNI_OK) {
        printf("Failed to create Java VM\n");
        return 1;
    } else {
        printf("Created Java VM successfully\n");
    }

    return 0;
}

Compiling native app (using Java 8):

OpenJ9:
gcc -o main -I ${JAVA_HOME}/include/ -I ${JAVA_HOME}/include/darwin/ -ldl main.c ${JAVA_HOME}/jre/lib/compressedrefs/libjvm.dylib -Wl,-rpath,${JAVA_HOME}/jre/lib/compressedrefs,-pagezero_size,0x1000

Hotspot:
gcc -o main -I ${JAVA_HOME}/include/ -I ${JAVA_HOME}/include/darwin/ -ldl main.c ${JAVA_HOME}/jre/lib/server/libjvm.dylib -Wl,-rpath,${JAVA_HOME}/jre/lib/server,-pagezero_size,0x1000
pdbain-ibm commented 5 years ago

I modified the launcher to run an application, set the options to -XX:+UseCompressedOops, and compiled against Hotspot w/o -pagezero_size. I dumped the memory map from a running process:

==== regions for process 11640  (non-writable and writable regions are interleaved)
REGION TYPE                      START - END             [ VSIZE  RSDNT  DIRTY   SWAP] PRT/MAX SHRMOD PURGE    REGION DETAIL
__TEXT                 000000010579d000-000000010579e000 [    4K     4K     0K     0K] r-x/rwx SM=COW          /Users/pdbain/macprojects/eclipse/launcher
__DATA                 000000010579e000-000000010579f000 [    4K     4K     4K     0K] rw-/rwx SM=COW          /Users/pdbain/macprojects/eclipse/launcher
__LINKEDIT             000000010579f000-00000001057a0000 [    4K     4K     0K     0K] r--/rwx SM=COW          /Users/pdbain/macprojects/eclipse/launcher
Kernel Alloc Once      00000001057a0000-00000001057a2000 [    8K     4K     4K     0K] rw-/rwx SM=PRV    
MALLOC metadata        00000001057a2000-00000001057a3000 [    4K     4K     4K     0K] r--/rwx SM=ZER          DefaultMallocZone_0x1057a2000 zone structure
MALLOC metadata        00000001057a3000-00000001057a4000 [    4K     4K     4K     0K] rw-/rwx SM=ZER    
MALLOC metadata        00000001057a4000-00000001057a5000 [    4K     4K     4K     0K] r--/rwx SM=PRV    
shared memory          00000001057a5000-00000001057a6000 [    4K     4K     4K     0K] r--/rw- SM=SHM    
__TEXT                 00000001057a6000-0000000105f6e000 [ 7968K  7968K     0K     0K] r-x/rwx SM=COW          /Users/pdbain/vm/jdk8u181-b13/Contents/Home/jre/l...

Compiling with -pagezero_size0x1000 gives a different map:

==== regions for process 11886  (non-writable and writable regions are interleaved)
REGION TYPE                      START - END             [ VSIZE  RSDNT  DIRTY   SWAP] PRT/MAX SHRMOD PURGE    REGION DETAIL
__TEXT                 000000000fae5000-000000000fae6000 [    4K     4K     0K     0K] r-x/rwx SM=COW          /Users/pdbain/macprojects/eclipse/launcher
__DATA                 000000000fae6000-000000000fae7000 [    4K     4K     4K     0K] rw-/rwx SM=COW          /Users/pdbain/macprojects/eclipse/launcher
__LINKEDIT             000000000fae7000-000000000fae8000 [    4K     4K     0K     0K] r--/rwx SM=COW          /Users/pdbain/macprojects/eclipse/launcher
__TEXT                 000000000fae8000-00000000102b0000 [ 7968K  7968K     0K     0K] r-x/rwx SM=COW          /Users/pdbain/vm/jdk8u181-b13/Contents/Home/jre/lib/server/libjvm.dylib
__DATA                 00000000102b0000-0000000010375000 [  788K   788K   788K     0K] rw-/rwx SM=COW          /Users/pdbain/vm/jdk8u181-b13/Contents/Home/jre/lib/server/libjvm.dylib
__DATA                 0000000010375000-00000000103a1000 [  176K   172K   172K     0K] rw-/rwx SM=PRV          /Users/pdbain/vm/jdk8u181-b13/Contents/Home/jre/lib/server/libjvm.dylib
__LINKEDIT             00000000103a1000-00000000105fe000 [ 2420K  2420K     0K     0K] r--/rwx SM=COW          /Users/pdbain/vm/jdk8u181-b13/Contents/Home/jre/lib/server/libjvm.dylib
Kernel Alloc Once      00000000105fe000-0000000010600000 [    8K     4K     4K     0K] rw-/rwx SM=PRV          
MALLOC metadata        0000000010600000-0000000010601000 [    4K     4K     4K     0K] r--/rwx SM=ZER          DefaultMallocZone_0x10600000 zone structure
MALLOC metadata        0000000010601000-0000000010602000 [    4K     4K     4K     0K] rw-/rwx SM=ZER          
MALLOC guard page      0000000010602000-0000000010603000 [    4K     0K     0K     0K] ---/rwx SM=ZER          
MALLOC metadata        0000000010603000-0000000010609000 [   24K    24K    24K     0K] rw-/rwx SM=ZER          
MALLOC guard page      0000000010609000-000000001060a000 [    4K     0K     0K     0K] ---/rwx SM=ZER          
MALLOC guard page      000000001060a000-000000001060b000 [    4K     0K     0K     0K] ---/rwx SM=NUL          
MALLOC metadata        000000001060b000-0000000010611000 [   24K    24K    24K     0K] rw-/rwx SM=PRV          
MALLOC guard page      0000000010611000-0000000010612000 [    4K     0K     0K     0K] ---/rwx SM=NUL          
MALLOC metadata        0000000010612000-0000000010613000 [    4K     4K     4K     0K] r--/rwx SM=PRV          
__TEXT                 0000000010613000-000000001061c000 [   36K    36K     0K     0K] r-x/rwx SM=COW          /Users/pdbain/vm/jdk8u181-b13/Contents/Home/jre/lib/libverify.dylib
sxa commented 5 years ago

I will take a look at a prototype build of something suitable on the adoptopenjdk machines ...

sxa commented 5 years ago

If anyone wants to pull a build from https://ci.adoptopenjdk.net/view/work%20in%20progress/job/SXA-build-macos-jdk11-LH/ and let me know if that solves anything (built with non compressed refs option) that would be appreciated

pdbain-ibm commented 5 years ago

That would be this build, right?

openjdk version "11.0.1" 2018-10-16
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.1+13-201810251613)
Eclipse OpenJ9 VM AdoptOpenJDK (build master-cca01361, JRE 11 Mac OS X amd64-64-Bit 20181025_1 (JIT enabled, AOT enabled)
OpenJ9   - cca01361
OMR      - 19d31aa4
JCL      - 88c0cee5e9 based on jdk-11.0.1+13)

If so, it is tested and working: Eclipse Version: 2018-09 (4.9.0) Build id: 20180917-1800 launches successfully and runs a simple program. Many thanks @sxa555 !

pdbain-ibm commented 5 years ago

@martinlippert FYI ^^^

martinlippert commented 5 years ago

Yes, starts up now... :-) THANKS!!!

Some strange error messages within my IDE coming up, but need to take a more detailed look at that, might be something completely unrelated.

pdbain-ibm commented 5 years ago

@martinlippert We are glad to help. Please feel free to contact me directly on Slack at openj9.slack.com.

martinlippert commented 5 years ago

Looks like I need an invite for that slack workspace ?!? Can you send me one?

AdamBrousseau commented 5 years ago

https://join.slack.com/t/openj9/shared_invite/enQtNDU4MDI4Mjk0MTk2LWM2MjliMTQ4NWM5YjMwNTViOTgzMzM2ZDhlOWJmZTc1MjhmYmRjMDg2NDljNGM0YTAwOWRiZDE0YzI0NjgyOWI

(From the OpenJ9 Website)

martinlippert commented 5 years ago

btw, when running my Eclipse using this, I get a bunch of these exceptions:

java.io.FileNotFoundException
    at org.eclipse.jdt.internal.core.JavaModelManager.throwExceptionIfArchiveInvalid(JavaModelManager.java:2996)
    at org.eclipse.jdt.internal.core.JavaModelManager.getZipFile(JavaModelManager.java:2934)
    at org.eclipse.jdt.internal.core.JavaModelManager.getZipFile(JavaModelManager.java:2920)
    at org.eclipse.jdt.internal.core.JarPackageFragmentRoot.getJar(JarPackageFragmentRoot.java:264)
    at org.eclipse.jdt.internal.core.JarPackageFragmentRoot.computeChildren(JarPackageFragmentRoot.java:144)
    at org.eclipse.jdt.internal.core.PackageFragmentRoot.buildStructure(PackageFragmentRoot.java:163)
    at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:268)
    at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:596)
    at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:326)
    at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:312)
    at org.eclipse.jdt.internal.core.JavaElement.getChildren(JavaElement.java:267)
    at org.eclipse.jdt.internal.core.PackageFragmentRoot.getModuleDescription(PackageFragmentRoot.java:888)
    at org.eclipse.jdt.internal.core.JarPackageFragmentRoot.getModuleDescription(JarPackageFragmentRoot.java:321)
    at org.eclipse.jdt.internal.core.search.matching.JavaSearchNameEnvironment.mapToClassPathLocation(JavaSearchNameEnvironment.java:188)
    at org.eclipse.jdt.internal.core.search.matching.JavaSearchNameEnvironment.computeClasspathLocations(JavaSearchNameEnvironment.java:134)
    at org.eclipse.jdt.internal.core.search.matching.JavaSearchNameEnvironment.<init>(JavaSearchNameEnvironment.java:78)
    at org.eclipse.jdt.internal.core.search.matching.IndexBasedJavaSearchEnvironment.create(IndexBasedJavaSearchEnvironment.java:334)
    at org.eclipse.jdt.internal.core.search.indexing.SourceIndexer.resolveDocument(SourceIndexer.java:169)
    at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.resolveDocument(JavaSearchParticipant.java:94)
    at org.eclipse.jdt.internal.core.search.indexing.IndexManager.indexResolvedDocument(IndexManager.java:552)
    at org.eclipse.jdt.internal.core.search.indexing.IndexManager$1.execute(IndexManager.java:1063)
    at org.eclipse.jdt.internal.core.search.processing.JobManager.run(JobManager.java:401)
    at java.base/java.lang.Thread.run(Thread.java:825)
martinlippert commented 5 years ago

should I file a bug for JDT for that? or would you like to take this further (since it works when running with the Oracle JDK 11)

martinlippert commented 5 years ago

https://join.slack.com/t/openj9/shared_invite/enQtNDU4MDI4Mjk0MTk2LWM2MjliMTQ4NWM5YjMwNTViOTgzMzM2ZDhlOWJmZTc1MjhmYmRjMDg2NDljNGM0YTAwOWRiZDE0YzI0NjgyOWI

(From the OpenJ9 Website)

Thanks for that, much appreciated !!!

pdbain-ibm commented 5 years ago

Further to https://github.com/eclipse/openj9/issues/3371#issuecomment-433416066

  1. Which version of Eclipse are you using?
  2. Under what conditions does the exception occur?
pdbain-ibm commented 5 years ago

@martinlippert Would you kindly close this issue and open another issue if you encounter further problems. Thank you for bringing this to our attention.

martinlippert commented 5 years ago

I tried today again with the latest build from the nightlies and it doesn't work (starting up Eclipse). Is the solution to this in a special branch or a special build only? Or is there anything I need to do when using the latest from nightly?

pdbain-ibm commented 5 years ago

You will need to use a "large heap" version of the JDK, which I don't believe is available yet as a regular build. @sxa555 I see https://github.com/AdoptOpenJDK/openjdk-build/issues/686 is closed, but I don't see any MacOS large heap builds.

sxa commented 5 years ago

I think they're just being mislabelled - have opened https://github.com/AdoptOpenJDK/openjdk-build/issues/744 to resolve that.

rubin55 commented 5 years ago

I see from the subject that this issue mentions JDK 11 explicitly, but I'm encountering this issue with JDK 8 as well. I just downloaded OpenJDK 8 OpenJ9 variant, release 202-b08 from here: https://adoptopenjdk.net/releases.html?variant=openjdk8&jvmVariant=openj9

$ java -version

OpenJDK Runtime Environment (build 1.8.0_202-b08)
Eclipse OpenJ9 VM (build openj9-0.12.0, JRE 1.8.0 Mac OS X amd64-64-Bit Compressed References 20190130_136 (JIT enabled, AOT enabled)
OpenJ9   - 04890c300
OMR      - d2f4534b
JCL      - 6501440d7a based on jdk8u202-b08)

When I try and start Eclipse using an eclipse.ini containing -vm as /Library/Java/JavaVirtualMachines/jdk8u202-b08/Contents/MacOS/libjli.dylib

I get:

JVMJ9VM015W Initialization error for library j9gc29(2): Failed to instantiate compressed references metadata; 200M requested

I don't see another download option - am I doing it wrong(tm)?

JasonFengJ9 commented 5 years ago

@rubin55 could you try MacOS x64 Large Heap?

rubin55 commented 5 years ago

@JasonFengJ9 I cannot run this particular instance of Eclipse with JDK 11; is there a JDK 8 version with large heap option for macOS? I do see that download option available for Linux, but not for macOS :-/.

JasonFengJ9 commented 5 years ago

Not able to find JDK 8 MacOS x64 Large Heap either.

@sxa555 any insights about availability of this particular build?

JasonFengJ9 commented 5 years ago

Thanks quick actions at https://github.com/AdoptOpenJDK/openjdk-build/issues/892, JDK 8 MacOS x64 Large Heap is available now.

fyi @rubin55

sxa commented 5 years ago

Yep all LH builds are now up - at the moment it needs a small about of manual tweaking to get it to show up properly after publishing.