Bug 562574 - Unable to run Eclipse or app with non-installed version of OpenJDK 11
Summary: Unable to run Eclipse or app with non-installed version of OpenJDK 11
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.15   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-28 09:53 EDT by Kent Xu CLA
Modified: 2020-04-28 23:43 EDT (History)
2 users (show)

See Also:


Attachments
sample code & error (259.89 KB, image/png)
2020-04-28 09:53 EDT, Kent Xu CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kent Xu CLA 2020-04-28 09:53:54 EDT
Created attachment 282603 [details]
sample code &  error

On OSX,  running  eclipse 2020-03 (also 2020-06m1) with jvm extracted from  Liberica 11.0.7 zipped package (not dmg or pkg https://download.bell-sw.com/java/11.0.7+10/bellsoft-jdk11.0.7+10-macos-amd64.zip).  When I launch the  app, the splash screen showed, prompted  user  to choose a workspace, then  crashed with  “No Java runtime present, requesting install.” in the console and a  OSX  Dialog  asking for Java 6.  This works fine when switched to use installed Liberica 11.0.7  via -vm in .ini file.

Likely related  to that.  I have an OSX App (based on 2020-03) also  with bundled Liberica  11.0.7 JRE from zipped package. It shows the same  behavior.  Splash screen  followed by the “No Java… “ message.  The program does step  into ApplicationWorkbenchWindowAdvisor.preWindowOpen() and  so  on until some AWT modules are invoked in one of the plugins. I further narrowed it down to  a particular case:   java.awt.Font.   Referencing this class triggers a chain reaction leads to sun.lwawt.macosx.LWCToolkit’s System.loadLibrary("awt”). I suspect  this  is what kill the  app but  there is no log or crash report generated to prove  that.  

I also  tested this by placing a dummy reference of this class as  the first line in ApplicationWorkbenchWindowAdvisor.preWindowOpen().  Surely it  killed the app right away. The crash stops  if I remove any usage of java.awt.Font. 

For some reason, I can get the  app  to work with the same jvm  by  launching  the app with  java command  instead of  Contents/MacOS/launchfilename, something like 

$TARGET_PATH/Contents/java/jre/bin/java -XstartOnFirstThread -verbose:class -Xdebug   --add-modules=ALL-SYSTEM  -jar $TARGET_PATH/Contents/Eclipse/plugins/org.eclipse.equinox.launcher_1.5.700.v20200207-2156.jar -debug -verbose

Of course, if I switch to use installed  JVM, it  works too.

Please see screenshot for  simple code snippet  and  the OSX error dialog.