Closed oweidner closed 1 year ago
It seems that this issue is specific to Orcale's JDK. With OpenJDK the extension / language server launches just fine. However, I still see a warning hinting at a similar problem:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$2 (file:/Users/architeuthis/.vscode/extensions/contextmapper.context-mapper-vscode-extension-6.5.0/lsp/lib/guice-3.0.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$2
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
java -version
openjdk version "15.0.2" 2021-01-19
OpenJDK Runtime Environment (build 15.0.2+7)
OpenJDK 64-Bit Server VM (build 15.0.2+7, mixed mode, sharing)
Thanks for reporting this issue @oweidner; good to know that this is a problem with Oracle's JDK. I'm aware of the warning you mentioned above. Unfortunately, this is a problem in the Xtext framework. I don't know if the @xtext guys already fixed this in a newer version; but I will check.
I am having same problem but with OpenJDK. VS Code info:
java -version
openjdk version "16.0.1" 2021-04-20
OpenJDK Runtime Environment (build 16.0.1+9-24)
OpenJDK 64-Bit Server VM (build 16.0.1+9-24, mixed mode, sharing)
Also the same with version 16 openjdk version "17" 2021-09-14 OpenJDK Runtime Environment (build 17+35-2724) OpenJDK 64-Bit Server VM (build 17+35-2724, mixed mode, sharing)
update: finally got it working by installing just version 15 openjdk 15 2020-09-15 OpenJDK Runtime Environment (build 15+36-1562) OpenJDK 64-Bit Server VM (build 15+36-1562, mixed mode, sharing)
For those who does not want install JDK 15 to run this extension, I found workaround for JDK 16 using infromation from here https://stackoverflow.com/questions/41265266/how-to-solve-inaccessibleobjectexception-unable-to-make-member-accessible-m What I did was changing how vs-code extension starts in %USERPROFILE%.vscode\extensions\contextmapper.context-mapper-vscode-extension-6.5.2\lsp\bin\context-mapper-lsp.bat by adding --add-opens java.base/java.lang=ALL-UNNAMED:
@rem Execute context-mapper-lsp
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %CONTEXT_MAPPER_LSP_OPTS% --add-opens java.base/java.lang=ALL-UNNAMED -classpath "%CLASSPATH%" org.eclipse.xtext.ide.server.ServerLauncher %CMD_LINE_ARGS%
Note that you can also export the --add-opens java.base/java.lang=ALL-UNNAMED
flag to CONTEXT_MAPPER_LSP_OPTS
in your respective environment to avoid having to edit files the extension that may be reverted at a later date.
Just hit the same issue on Windows and also on Mac. The workaround from @evgeniykim does not help in my case. Is there any other known workaround?
Hi @oweidner, @karimElJed, @vancluever, @evgeniykim, @therealjawss Today we released v6.7.0 of Context Mapper that finally supports Java 17: https://contextmapper.org/news/2022/12/02/v6.7.0-released/ From my perspective this issue should be solved, so I'll close it. If you still experience issues, feel free to re-open or create other issues. Best regards, Stefan
I am having problems getting the VS Code plugin to work:
Darwin 20.4.0 Darwin Kernel Version 20.4.0 x86_64
1.56.0
v6.5.0
"16.0.1" 2021-04-20 Java(TM) SE Runtime Environment (build 16.0.1+9-24)
dot - graphviz version 2.47.1 (20210417.1919)
The error message I get is
The CML Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted.
The console output looks like this: