简体   繁体   中英

Xtext, import another project in MyDsl project

I'm using Xtext to make a Dsl. In my interpreter class, I need to use classes from another project. Here is my project

My actual project is org.xtext.example.mydsl and I need to use classes from the jDLMS project
I use it in this line:

import com.sagemcom.test.LoadProfile
class MyDslInterepeter {
val Jtest = new LoadProfile()

I first tried to add the project in the build path. when I ran the mydsl project, it works. But in the second instance of eclipse when running the file with the .mydsl extension, it fails with the " java.lang.NoClassDefFoundError: com/sagemcom/test/LoadProfile " exception.
I also tried exporting the project into a jar file and add it in the build path -> libraries. It also fails with the same exception

jDLMS should be deployed as an eclipse plugin in the second instance and your plugin ( org.xtext.example.mydsl ) should have a dependency to it. Is it so?

i found a solution here enter link description here

  1. copy it to a new lib folder inside the plugin
  2. adapt the manifest and add the jars as entries (runtime tab, classpath section)
  3. add the jars to be included in build.properties

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM