Graal: IntelliJ 2018.3 crashes when using Graal 1.0.0-CE-RC13 as boot jdk

Created on 8 Mar 2019  路  11Comments  路  Source: oracle/graal

When switching boot jdk for IntelliJ/Pycharm 2018.3 to Graal 1.0.0-CE-RC13 using root graalvm-ce-1.0.0-rc13 folder it crashes since there is no libjava.dylib in Contents/Home/lib folder.

2019-03-08 11:24:32.696 pycharm[18514:363522] Value of PYCHARM_VM_OPTIONS is (null)
2019-03-08 11:24:32.696 pycharm[18514:363522] Processing VMOptions file at /Users/horm/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/183.5912.18/PyCharm.app.vmoptions
2019-03-08 11:24:32.696 pycharm[18514:363522] Done
Error: could not find libjava.dylib
Failed to GetJREPath()
2019-03-08 11:24:32.697 pycharm[18514:363522] JNI_CreateJavaVM (/Library/Java/JavaVirtualMachines/graalvm-ce-1.0.0-rc13) failed: 4294967295

However, using subfolder graalvm-ce-1.0.0-rc13/Contents/Home/jre works so there are probably some symlinks missing.

Most helpful comment

thanks!!! the problem was cp -r which should not be used in mac os. with cp -R all links are copied and pycharm launches.

All 11 comments

As far as I can see, there's only a single libjava.dylib in the stock JDK 8u202 as well:

> find /Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk -name libjava.dylib
/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/lib/libjava.dylib

Do you know how IntelliJ/Pycharm 2018.3 is working with the stock JDK?

IntelliJ/Pycharm 2018.3 is using it's own bundled jdk but I just tried it with the stock jdk 8u201 (edit: also 8u202) and this works

Ok. We'd have to know exactly how IntelliJ/Pycharm 2018.3 is trying to find libjava.dylib to potentially resolve this. A number of other apps that resolve Java home seem to work in GraalVM so it must be doing something different.

Could you set IDEA_LAUNCHER_DEBUG in the environment to get some more debug info?

with IDEA_LAUNCHER_DEBUG:

2019-03-11 11:56:15.706 pycharm[31179:302703] VM from:
2019-03-11 11:56:15.707 pycharm[31179:302703] IDE profile
2019-03-11 11:56:15.707 pycharm[31179:302703] /Library/Java/JavaVirtualMachines/graalvm-ce-1.0.0-rc13
2019-03-11 11:56:15.708 pycharm[31179:302714] Value of PYCHARM_VM_OPTIONS is (null)
2019-03-11 11:56:15.708 pycharm[31179:302714] Processing VMOptions file at /Users/horm/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/183.5912.18/PyCharm.app.vmoptions
2019-03-11 11:56:15.709 pycharm[31179:302714] Reading at /Users/horm/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/183.5912.18/PyCharm.app.vmoptions OK
2019-03-11 11:56:15.709 pycharm[31179:302714] Done
Error: could not find libjava.dylib
Failed to GetJREPath()
2019-03-11 11:56:15.709 pycharm[31179:302714] JNI_CreateJavaVM (/Library/Java/JavaVirtualMachines/graalvm-ce-1.0.0-rc13) failed: 4294967295

Could you also see what the same logging say when you use the graalvm-ce-1.0.0-rc13/Contents/Home/jre sub-folder?
I am under the impression that this launcher will ignore things that don't look like a "bundle" (i.e., with Contents/Info.plist) and so it "works" when specifying graalvm-ce-1.0.0-rc13/Contents/Home/jre simply because it ignore it and picks an other JVM on the system.

Also cou you check that things look like this:

$ readlink graalvm-ce-1.0.0-rc13/Contents/MacOS/libjli.dylib
../Home/jre/lib/jli/libjli.dylib

(i.e., check that Contents/MacOS/libjli.dylib is a link and where it points to)

your're right. when specifying the stock jdk it's loading correctly:

2019-03-11 14:25:57.412 pycharm[44885:408933] VM from:
2019-03-11 14:25:57.413 pycharm[44885:408933] IDE profile
2019-03-11 14:25:57.413 pycharm[44885:408933] /Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk
2019-03-11 14:25:57.415 pycharm[44885:408938] Value of PYCHARM_VM_OPTIONS is (null)
2019-03-11 14:25:57.415 pycharm[44885:408938] Processing VMOptions file at /Users/manuel/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/183.5912.18/PyCharm.app.vmoptions
2019-03-11 14:25:57.416 pycharm[44885:408938] Reading at /Users/manuel/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/183.5912.18/PyCharm.app.vmoptions OK
2019-03-11 14:25:57.416 pycharm[44885:408938] Done

vs using the graal jre subfolder it just loads the bundled jdk:

2019-03-11 14:29:08.034 pycharm[45198:411851] Reading at /Users/manuel/Library/Preferences/PyCharm2018.3/idea.properties OK
2019-03-11 14:29:08.034 pycharm[45198:411851] allVms required 1.8*,1.8+
2019-03-11 14:29:08.035 pycharm[45198:411851] Found Java Virtual Machines:
2019-03-11 14:29:08.035 pycharm[45198:411851] /Users/manuel/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/183.5912.18/PyCharm.app/Contents/jdk
2019-03-11 14:29:08.035 pycharm[45198:411851] Required VMs: 1.8*,1.8+
2019-03-11 14:29:08.035 pycharm[45198:411851] Chosen VM:
2019-03-11 14:29:08.035 pycharm[45198:411851] /Users/manuel/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/183.5912.18/PyCharm.app/Contents/jdk
2019-03-11 14:29:08.038 pycharm[45198:411862] Value of PYCHARM_VM_OPTIONS is (null)
2019-03-11 14:29:08.039 pycharm[45198:411862] Processing VMOptions file at /Users/manuel/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/183.5912.18/PyCharm.app.vmoptions
2019-03-11 14:29:08.039 pycharm[45198:411862] Reading at /Users/manuel/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/183.5912.18/PyCharm.app.vmoptions OK
2019-03-11 14:29:08.039 pycharm[45198:411862] Done

It doesn't look like Contents/MacOS/libjli.dylib is a link:

Manuels-MacBook-Pro:MacOS manuel$ readlink libjli.dylib
Manuels-MacBook-Pro:MacOS manuel$ ls -la
total 120
drwxr-xr-x@ 3 root  wheel     96 Mar 11 11:32 .
drwxr-xr-x@ 5 root  wheel    160 Mar 11 11:32 ..
-rwxr-xr-x@ 1 root  wheel  61428 Mar 11 11:32 libjli.dylib

It doesn't look like Contents/MacOS/libjli.dylib is a link

That's your problem. With the way libjli.dylib works, it _needs_ to be in jre/lib/jli (see java_md_macosx.c).

How did you extract the archive? I checked and it seems to be a link in the archive. Maybe your extracting tool replaced the link with a copy?

You can also try to restore the link manually and check that it works?

thanks!!! the problem was cp -r which should not be used in mac os. with cp -R all links are copied and pycharm launches.

however, the performance is pretty bad. 1-2 seconds delay when changing the cursor position using the mouse, beachball when selecting a file. would not recommend using it. this is also true for the stock jdk so it seams like the bundled jdk is heavily optimized...

I'm glad we could resolve it.

Indeed Jetbrain's bundled JDK 8 has a lot of fixes, especially around AWT/String/Desktop integration and nowadays Intellij & co. are practically unusable without those fixes.

Was this page helpful?
0 / 5 - 0 ratings