Open zanqi opened 3 weeks ago
Might be related to #1094 as well.
@zanqi It looks like that you have both Java 21.0.3 installed and 17.0.11. Is it the case that VS Code starts with 21 but you are targeting 17 for that project?
@karianna I don't have jdk 17 installed, but the redhat java extension for vscode comes with an embedded JDK 17.
@testforstephen could you help take a look?
@karianna I don't have jdk 17 installed, but the redhat java extension for vscode comes with an embedded JDK 17.
Just to clarify that the embedded JDK is for the language service internal use only. User still needs to install the JDK corresponding to their project needs.
Hey @zanqi, I followed your reproducing steps and Java extension is started well using the embedded JRE 17. See the screenshot below.
The embedded JRE of Java extension is from JustJ (which is based on Temurin), I'm not familiar with the specific JDK errors. Can you try to change the user setting "java.jdt.ls.java.home": "/usr/local/sdkman/candidates/java/21.0.3-tem"
? This will force the Java extension to use your specified JDK to start the Java tooling.
Hi, @testforstephen, the setting key "java.jdt.ls.java.home"
is not recognized by vscode. One difference between our setup is I am using vscode on a mac.
F1 -> Preferences: Open User Settings
Yes, I run docker on Windows 11. Can you share specific info for your macOS machine?
Thanks for the instruction. I changed the Remote settings accordingly. Unfortunately, the problem still appears. Only this time, the error is reported by JDK 21
My mac info: Chip: Apple M3 Pro OS: macOS Sonama Version 14.5
The error:
[thread 8687 also had an error]
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007ffffed93690, pid=8670, tid=8672
#
# JRE version: OpenJDK Runtime Environment Temurin-21.0.3+9 (21.0.3+9) (build 21.0.3+9-LTS)
# Java VM: OpenJDK 64-Bit Server VM Temurin-21.0.3+9 (21.0.3+9-LTS, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, parallel gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0xd7c690] oopDesc* PSPromotionManager::copy_unmarked_to_survivor_space<false>(oopDesc*, markWord)+0x40
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /workspaces/compiler/hs_err_pid8670.log
[thread 8688 also had an error]
#
# If you would like to submit a bug report, please visit:
# https://github.com/adoptium/adoptium-support/issues
#
I noticed that your image is for AMD64 (x64), but your machine uses Apple Silicon. Was this intentional? Have you tried using the ARM64 image?
Yes, some of the packages I need are compiled for i386. It only works on AMD64 but not ARM64.
I tried switching the image to ARM64. The Java language server indeed works.
So this is a platform compatibility issue. let's narrow it down a bit. Can you manually run Java command on the devcontainer? for example, javac Hello.java
and java Hello
. I want to confirm if the problem is with the JDK itself or with the Java extension.
javac
and java
commands work fine. Only the Java extension is having trouble.
Did it work before? Yes, used to work a month ago
@zanqi Do you know from which version of vscode-java the issue starts occurring?
@rgrunber The user is running dev container with Ubuntu x64 image on Apple M3 Pro (arm64), and Java extension fails to start. Any thoughts on this issue?
Edited: Used to work a month ago, so the issue likely started with vscode-java version 1.31.0.
I don't know the last working version.
Please provide a brief summary of the bug
I use vscode devcontainer on a java project. Got the following error for the past month and couldn't get IntelliSense for java. Log file attached. hs_err_pid939.log
Did you test with the latest update version?
Please provide steps to reproduce where possible
Expected Results
no error
Actual Results
as reported
What Java Version are you using?
openjdk 21.0.3 2024-04-16 LTS OpenJDK Runtime Environment Temurin-21.0.3+9 (build 21.0.3+9-LTS) OpenJDK 64-Bit Server VM Temurin-21.0.3+9 (build 21.0.3+9-LTS, mixed mode, sharing)
What is your operating system and platform?
Ubuntu 24.04 LTS on amd64
How did you install Java?
vscode devcontainer, select java in select container features
Did it work before?
Did you test with other Java versions?
Relevant log output