Classpath hell with Truffle development
Timothy Baldridge
tbaldridge at gmail.com
Wed Nov 21 05:51:32 UTC 2018
in my continued adventures of writing a Truffle language, I'm hitting an
annoying problem. It seems that in order to compile my language I need to
load TruffleLanguage (from truffle-api) on my classpath. However, once I
do, graalvm loads the class again. I then get a "Cannot cast X to
TruffleLanguage" exception, if I go in with a debugger I see that my
language does inherit from TruffleLanguage, just not the TruffleLanguage
that Graal is expecting. If I run the jvm with -verbose:class I see the
following lines:
[Loaded com.oracle.truffle.api.TruffleLanguage from
file:/home/tbaldrid/graalvm-ce-1.0.0-rc9/jre/lib/jvmci/../truffle/truffle-api.jar]
[Loaded com.oracle.truffle.api.TruffleLanguage from
file:/home/tbaldrid/graalvm-ce-1.0.0-rc9/jre/lib/truffle/truffle-api.jar]
Any ideas what's causing this? If I remove truffle-api from my project
dependencies then the project won't load at all due to missing classes. If
I add truffle-api, then I get duplicates.
I'm doing this with a maven project, Intelij and I'm using graal-vm as my
JDK.
Timothy
More information about the graal-dev
mailing list