Classpath hell with Truffle development

Timothy Baldridge tbaldridge at gmail.com
Wed Nov 21 06:05:27 UTC 2018


Welp, my google-fu finally kicked in and I found this:
https://github.com/oracle/graal/issues/311, adding -XX:-UseJVMCIClassLoader
to the JVM invocation fixed my issues.

On Tue, Nov 20, 2018 at 9:51 PM Timothy Baldridge <tbaldridge at gmail.com>
wrote:

> 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
>


-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)


More information about the graal-dev mailing list