Closed zoey1124 closed 2 years ago
You're using Java 8. Install Java 17, and you should be good to go.
Now I've upgraded to Java 17
$ java -version
openjdk version "17.0.4" 2022-07-19
OpenJDK Runtime Environment Homebrew (build 17.0.4+0)
OpenJDK 64-Bit Server VM Homebrew (build 17.0.4+0, mixed mode, sharing)
When I run CarBrake.if
, it compiles successfully. However, it will throw the runtime error
Parsing took: 25 ms
Syntax check OK! Resource: file:///Users/mengzhusun/Desktop/examples-lingua-franca/Cpp/src/CarBrake/CarBrake.lf
[Info - 4:12:32 PM] Generating diagram for input: 'file:///Users/mengzhusun/Desktop/examples-lingua-franca/Cpp/src/CarBrake/CarBrake.lf'
Jul 20, 2022 4:12:32 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint notify
WARNING: Failed to send notification message.
java.lang.reflect.InaccessibleObjectException: Unable to make field private volatile java.lang.String java.lang.Thread.name accessible: module java.base does not "opens java.lang" to unnamed module @2d58d9ed
......
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
Any suggestions on how to proceed?
We have known bugs with Mac when using diagrams (#27), and the upcoming release may resolve them in the next few days. I know very little about how to fix these issues because they seem to be related to the use of Gson as a transitive dependency via KLighD. (The stack trace posted above looks very abbreviated, so let me know if it is different from what I think.)
Shaokai had a very similar issue at some point, but I do not remember if/how he resolved it. Do you remember, @lsk567?
Just so that we have everything in one place, this was Shaokai's stack trace:
[Info - 3:22:12 PM] Generating diagram for input: 'file:///Users/shaokai/git/lingua-franca/test/C/src/ActionDelay.lf'
May 09, 2022 3:22:12 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint notify
WARNING: Failed to send notification message.
java.lang.reflect.InaccessibleObjectException: Unable to make field private volatile java.lang.String java.lang.Thread.name accessible: module java.base does not "opens java.lang" to unnamed module @685fa119
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:180)
at java.base/java.lang.reflect.Field.setAccessible(Field.java:174)
at com.google.gson.internal.reflect.UnsafeReflectionAccessor.makeAccessible(UnsafeReflectionAccessor.java:44)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:159)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:102)
at com.google.gson.Gson.getAdapter(Gson.java:489)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:117)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:166)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:102)
at com.google.gson.Gson.getAdapter(Gson.java:489)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:117)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:166)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:102)
at com.google.gson.Gson.getAdapter(Gson.java:489)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:117)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:166)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:102)
at com.google.gson.Gson.getAdapter(Gson.java:489)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:117)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:166)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:102)
at com.google.gson.Gson.getAdapter(Gson.java:489)
at org.eclipse.lsp4j.jsonrpc.json.adapters.CollectionTypeAdapter.write(CollectionTypeAdapter.java:138)
at org.eclipse.lsp4j.jsonrpc.json.adapters.CollectionTypeAdapter.write(CollectionTypeAdapter.java:40)
at com.google.gson.Gson.toJson(Gson.java:735)
at org.eclipse.sprotty.server.json.PropertyBasedTypeAdapter.writeProperty(PropertyBasedTypeAdapter.java:212)
at org.eclipse.sprotty.server.json.PropertyBasedTypeAdapter.writeProperties(PropertyBasedTypeAdapter.java:194)
at org.eclipse.sprotty.server.json.PropertyBasedTypeAdapter.write(PropertyBasedTypeAdapter.java:178)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:69)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:127)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:245)
at com.google.gson.Gson.toJson(Gson.java:735)
at org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.write(MessageTypeAdapter.java:434)
at org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.write(MessageTypeAdapter.java:55)
at com.google.gson.Gson.toJson(Gson.java:735)
at com.google.gson.Gson.toJson(Gson.java:714)
at org.eclipse.lsp4j.jsonrpc.json.MessageJsonHandler.serialize(MessageJsonHandler.java:145)
at org.eclipse.lsp4j.jsonrpc.json.MessageJsonHandler.serialize(MessageJsonHandler.java:140)
at org.eclipse.lsp4j.jsonrpc.json.StreamMessageConsumer.consume(StreamMessageConsumer.java:59)
at org.eclipse.lsp4j.jsonrpc.validation.ReflectiveMessageValidator.consume(ReflectiveMessageValidator.java:68)
at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.notify(RemoteEndpoint.java:126)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:577)
at org.eclipse.lsp4j.jsonrpc.services.EndpointProxy.invoke(EndpointProxy.java:112)
at jdk.proxy2/jdk.proxy2.$Proxy39.notify(Unknown Source)
at org.eclipse.lsp4j.jsonrpc.services.EndpointProxy.invoke(EndpointProxy.java:88)
at jdk.proxy2/jdk.proxy2.$Proxy42.accept(Unknown Source)
at org.eclipse.sprotty.xtext.ls.DiagramServerManager.lambda$getDiagramServer$1(DiagramServerManager.java:166)
at org.eclipse.sprotty.DefaultDiagramServer.dispatch(DefaultDiagramServer.java:195)
at de.cau.cs.kieler.klighd.lsp.KGraphDiagramServer.updateDiagramOptions(KGraphDiagramServer.java:257)
at de.cau.cs.kieler.klighd.lsp.KGraphDiagramServer.prepareUpdateModel(KGraphDiagramServer.java:222)
at de.cau.cs.kieler.klighd.lsp.KGraphDiagramUpdater$2.accept(KGraphDiagramUpdater.java:144)
at de.cau.cs.kieler.klighd.lsp.KGraphDiagramUpdater$2.accept(KGraphDiagramUpdater.java:1)
at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2147)
at org.eclipse.xtext.ide.server.concurrent.AbstractRequest.complete(AbstractRequest.java:65)
at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$doRun$0(ReadRequest.java:67)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
I think I have the exactly same error message.
I am now able to run some part of the examples, some other fails as #27 mentions
I can run all examples for now. Problems solved. All I did actually is install Java 17 and reboot everything.
I am trying to go through LF mini-examples in this repo through my local VS Code IDE. I installed the Lingua Franca for VS Code in VS Code Market space, then I try to run the
.lf
file following the instructions. But there is an error for Java to compile and run, here is the error message:My operating system is macOS with version 12.4 running on Apple M1 chip. My Java version is
Any suggestions about how should I proceed here?