Bug 567590 - Unable to import Gradle project as it exits requiring legacy Java version
Summary: Unable to import Gradle project as it exits requiring legacy Java version
Status: CLOSED DUPLICATE of bug 549813
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.18   Edit
Hardware: Macintosh Mac OS X
: P3 blocker (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-05 03:02 EDT by Graeme Rocher CLA
Modified: 2020-10-05 08:41 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Graeme Rocher CLA 2020-10-05 03:02:56 EDT
Downloading the latest Eclipse Java IDE on a Mac installing it and trying to import a Gradle project results in

https://twitter.com/graemerocher/status/1313009910196699137

Trying to follow the instructions to install the legacy Java version results in

https://twitter.com/graemerocher/status/1313010408463175681
Comment 1 Graeme Rocher CLA 2020-10-05 03:05:23 EDT
Happens attempting to import a Maven project as well
Comment 2 Mickael Istria CLA 2020-10-05 04:00:36 EDT
Can you please elaborate how you attempt to import the project (using m2e)?
Do you have some interesting content in <workspace>/.metadata/.log?

Note that this error is misleading Java SE 6 is not required (it's even not compatible any more), but it's a message that sometimes erreneously shows up on Mac when trying to find the installed Java version.
Hopefully, the log will lead to the actual faulty code...
Comment 3 Mickael Istria CLA 2020-10-05 04:04:07 EDT
Also can you please detail which Java version you're using to run the IDE? (it should be included in the .log file)
Comment 4 Graeme Rocher CLA 2020-10-05 06:43:54 EDT
It happens with both JDK 14 and JDK 15 installed via SDKman.


I recorded a video demonstrating the issue https://www.dropbox.com/s/v88l1j7vezvcy2u/Eclipse.mp4?dl=0
Comment 5 Mickael Istria CLA 2020-10-05 08:12:18 EDT
(In reply to Graeme Rocher from comment #4)
> It happens with both JDK 14 and JDK 15 installed via SDKman.
> 
> 
> I recorded a video demonstrating the issue
> https://www.dropbox.com/s/v88l1j7vezvcy2u/Eclipse.mp4?dl=0

Please provide some log files.
Also please try running from CLI as it could be some JVM crash, and this is logged in console usually.
Comment 6 Graeme Rocher CLA 2020-10-05 08:22:07 EDT
from the CLI this is the output:

➜  MacOS ./eclipse
WARNING: Using incubator modules: jdk.incubator.jpackage, jdk.incubator.foreign
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/graemerocher/eclipse-workspace/.metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.1.16.0.20200318-1040.xml
org.eclipse.m2e.logback.configuration: Initializing logback
No Java runtime present, requesting install.


No errors as  far as I can see.

I don't see anything relevant in the "Error log" view, how do I get to logs?
Comment 7 Graeme Rocher CLA 2020-10-05 08:23:28 EDT
If I go to "Navigate -> Open Setup Log" the same problem occurs and it exits with the Java 6 error
Comment 8 Mickael Istria CLA 2020-10-05 08:29:57 EDT
> No Java runtime present, requesting install.

That's a hint. It seems like calling `java -version` from the IDE triggers this annoying MacOS specific pop-up. There are some articles about it here and there by copying the error message.
As MacOS tends to force more and more usage of fully self-contained applications and cause troubles in cases where multiple apps want to inter-operate nicely, I suggest you install a JRE inside your IDE that will be used in place of your installed Java.  Go to https://download.eclipse.org/justj/jres/15/updates/ and install a complete Java Runtime specifically for the IDE, and your OS should hopefully stop popping irrelevant warnings.
I'm pretty sure there is something that can be done at OS level to allow Eclipse IDE to properly run the expected version of java, but I can't help with that.
Comment 9 Mickael Istria CLA 2020-10-05 08:34:05 EDT
@Sarika See this scenario, it looks like Eclipse IDE feels not much usable on macOS under some circumstances. Do you think there are opportunities to improve the story in the IDE itself (apart of embedded a Java runtime or tweaking the OS, or installing a better OS :P )?
Comment 10 Mickael Istria CLA 2020-10-05 08:41:30 EDT

*** This bug has been marked as a duplicate of bug 549813 ***