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

Gradle Java project not detected #862

Closed
xehpuk opened this issue Oct 17, 2024 · 3 comments
Closed

Gradle Java project not detected #862

xehpuk opened this issue Oct 17, 2024 · 3 comments

Comments

@xehpuk
Copy link

xehpuk commented Oct 17, 2024

Type: Bug

I created a Gradle project in IntelliJ IDEA. Opened the folder in VS Code. It doesn't recognize the Java project: "No Java projects found in the current workspace."
The Gradle extension does work though.

Extension version: 0.24.0
VS Code version: Code 1.94.2 (384ff7382de624fb94dbaf6da11977bba1ecd427, 2024-10-09T16:08:44.566Z)
OS version: Windows_NT x64 10.0.22631
Modes:

System Info
Item Value
CPUs 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz (16 x 2304)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 31.73GB (15.56GB free)
Process Argv
Screen Reader no
VM 0%
@xehpuk
Copy link
Author

xehpuk commented Oct 17, 2024

Found this in the log file:

Log
!ENTRY org.eclipse.jdt.ls.core 4 0 2024-10-17 23:45:21.128
!MESSAGE Initialization failed 
!STACK 0
java.util.concurrent.CompletionException: org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.For more details on the daemon, please refer to https://docs.gradle.org/8.10.2/userguide/gradle_daemon.html in the Gradle documentation.
Process command line: C:\Program Files\Eclipse Adoptium\jextract-22\bin\java.exe --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -cp C:\Users\xehpuk\.gradle\wrapper\dists\gradle-8.10.2-bin\a04bxjujx95o3nb99gddekhwo\gradle-8.10.2\lib\gradle-daemon-main-8.10.2.jar -javaagent:C:\Users\xehpuk\.gradle\wrapper\dists\gradle-8.10.2-bin\a04bxjujx95o3nb99gddekhwo\gradle-8.10.2\lib\agents\gradle-instrumentation-agent-8.10.2.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.10.2
Please read the following process output to find out more:
-----------------------
Error occurred during initialization of boot layer
java.lang.module.FindException: Module java.instrument not found

	at java.base/java.util.concurrent.CompletableFuture.reportJoin(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.join(Unknown Source)
	at com.microsoft.gradle.bs.importer.Utils.getBuildTargetsMappedByProjectPath(Utils.java:47)
	at com.microsoft.gradle.bs.importer.GradleBuildServerProjectImporter.importProjects(GradleBuildServerProjectImporter.java:322)
	at com.microsoft.gradle.bs.importer.GradleBuildServerProjectImporter.importToWorkspace(GradleBuildServerProjectImporter.java:226)
	at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.importProjects(ProjectsManager.java:164)
	at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.initializeProjects(ProjectsManager.java:126)
	at org.eclipse.jdt.ls.core.internal.handlers.InitHandler$1.runInWorkspace(InitHandler.java:277)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:43)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

The problem was that a random java.exe from the path was chosen as a JDK, which it wasn't.

@jdneo
Copy link
Member

jdneo commented Oct 18, 2024

Have you tried to specify the JDK via the setting java.import.gradle.java.home

Copy link

github-actions bot commented Nov 1, 2024

This issue has been closed automatically because it needs more information and has not had recent activity. Please reach out if you have or find the answers we need so that we can investigate further.

@github-actions github-actions bot closed this as completed Nov 1, 2024
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

2 participants