Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java projects aren't imported to IDE after update #2698

Closed
olgapshen opened this issue Sep 26, 2022 Discussed in #2697 · 7 comments
Closed

Java projects aren't imported to IDE after update #2698

olgapshen opened this issue Sep 26, 2022 Discussed in #2697 · 7 comments

Comments

@olgapshen
Copy link

olgapshen commented Sep 26, 2022

Discussed in #2697

Originally posted by olgapshen September 26, 2022
I try to submit follow issuem and it don't gives me "Submit new issue" button available...

Environment
  • Operating System: openSUSE Leap 15.3
  • JDK version: openjdk version "11.0.13" 2021-10-19
  • Visual Studio Code version: 1.71.2
  • Java extension version: v1.10.0
Steps To Reproduce
  1. F1 -> Java: Clean Java Language ...
  2. Reload and delete

Sample project
Logs

Current Result
  • Java Projects tab displays no projects, just "Import Projects" button
  • No server log file availabe
  • Configure Java Runtime page displays nothig, except "Refresh" button
Expected Result

Java project is imported to IDE

Additional Informations

Issue started after update to recent version.
Error from "Developer Tools":

ERR ENOENT: no such file or directory, open '/home/olga/.config/Code/User/workspaceStorage/a173b3b78960646b4119193930553375/redhat.java/jdt_ws/.metadata/.log': Error: ENOENT: no such file or directory, open '/home/olga/.config/Code/User/workspaceStorage/a173b3b78960646b4119193930553375/redhat.java/jdt_ws/.metadata/.log'

@jdneo
Copy link
Collaborator

jdneo commented Sep 26, 2022

image

Is there an error message when you opened your project in VSCode? - Click the bell icon at the bottom right corner

@olgapshen
Copy link
Author

No... No such message while oppening the IDE or during the usage.

@testforstephen
Copy link
Collaborator

@olgapshen I believe your issue duplicates with #2655 (comment) and microsoft/vscode-java-debug#1212. The JDK on OpenSUSE doesn't contain the release file, that breaks the Java extension.

@olgapshen
Copy link
Author

Hi! Several new things.

First of all, I upgraded Gradle to 7.5.1 and successfully built the project with VSCode Gradle plugin.
The screenshot below.

Second I messed little button in bottom of the screen: "Lightweight mode", I pressed, and IDE tried to build the Java project, but with new errors.

I updated the logs in the repo:

изображение

@olgapshen
Copy link
Author

olgapshen commented Sep 26, 2022

@olgapshen I believe your issue duplicates with #2655 (comment) and microsoft/vscode-java-debug#1212. The JDK on OpenSUSE doesn't contain the release file, that breaks the Java extension.

Sorry, but no, as I see I have release version since it doesn't have -devel suffix.
And I just updated the package:

изображение

@testforstephen
Copy link
Collaborator

!ENTRY org.eclipse.jdt.ls.core 4 0 2022-09-26 13:11:44.181
!MESSAGE Initialization failed 
!STACK 0
java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.internal.compiler.util.JrtFileSystem.walkModuleImage(org.eclipse.jdt.internal.compiler.util.JRTUtil$JrtFileVisitor, int)" because the return value of "org.eclipse.jdt.internal.compiler.util.JRTUtil.getJrtSystem(java.io.File, String)" is null
	at org.eclipse.jdt.internal.compiler.util.JRTUtil.walkModuleImage(JRTUtil.java:242)
	at org.eclipse.jdt.internal.core.JavaProject.loadModulesInJimage(JavaProject.java:983)
	at org.eclipse.jdt.internal.core.JavaProject.computePackageFragmentRoots(JavaProject.java:782)
	at org.eclipse.jdt.internal.core.JavaProject.computePackageFragmentRoots(JavaProject.java:1103)
	at org.eclipse.jdt.internal.core.JavaProject.computePackageFragmentRoots(JavaProject.java:1048)
	at org.eclipse.jdt.internal.core.JavaProject.computePackageFragmentRoots(JavaProject.java:1025)
	at org.eclipse.jdt.internal.core.JavaProject.buildStructure(JavaProject.java:538)
	at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:266)
	at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:597)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:328)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:314)
	at org.eclipse.jdt.internal.core.JavaElement.getChildren(JavaElement.java:269)
	at org.eclipse.jdt.internal.core.JavaProject.getPackageFragmentRoots(JavaProject.java:2384)
	at org.eclipse.jdt.internal.core.JavaProject.getPackageFragments(JavaProject.java:2408)
	at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.cleanupResources(ProjectsManager.java:278)
	at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.initializeProjects(ProjectsManager.java:107)
	at org.eclipse.jdt.ls.core.internal.handlers.InitHandler$1.runInWorkspace(InitHandler.java:244)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:43)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

Looking at the logs you shared, it's exactly same as #2655 (comment) and microsoft/vscode-java-debug#1212.

A quick workaround is to manually create a release file in your jdk home.

sudo sh -c 'echo "JAVA_VERSION=\"11.0.16.0\"" > /usr/lib64/jvm/java-11-openjdk-11/release'

@olgapshen
Copy link
Author

Thank you very much!!! It really was a problem! You are the best!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants