mcoblenz / Obsidian

Obsidian language development
BSD 3-Clause "New" or "Revised" License
76 stars 10 forks source link

codemodel library not included in compiler jar #11

Open tyleretzel opened 7 years ago

tyleretzel commented 7 years ago

I get the following exception when running the "artifact" compiler jar: Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/codemodel/internal/JCodeModel.

The codemodel library is probably included in the code via the Java SDK somehow. Perhaps it's in one of the jars listed in "Project Structure -> Platform Settings -> SDKs -> Classpath"?

mcoblenz commented 7 years ago

The issue is that this file needs to be on the bootclasspath: /Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/lib/tools.jar

But I need to figure out how to specify this inside the jar file instead of on the command line when invoking it.

tyleretzel commented 7 years ago

Perhaps an easier way out is just to include the codemodel library as a dependency (it is indeed on maven, so we could just treat it like the other libraries). Of course, there may be reasons not to do this (it makes our jar bigger, the library seems to come with the JDK installation, etc.). Thoughts?

mcoblenz commented 7 years ago

It's not obvious how to specify this in the manifest; I tried specifying

Boot-Class-Path: /Library/Java/JavaVirtualMachines/
 jdk1.8.0_92.jdk/Contents/Home/lib/tools.jar

but that didn't help. For now, we can specify the bootclasspath when we invoke Obsidian.

mcoblenz commented 7 years ago

Yeah, it's probably bad form to copy part of the JDK into our project. I'm also not sure what the licensing implications of that would be if we wanted to distribute it.