How do I use classes from external jars in the generator?
I have some external jars and want to use classes from them in the code to generate. In the calculator tutorial these external jars (for swing) were imported by editing the sandbox model properties. Of course my own jars are not available there, so I added them via Settings/MPS Library Manager, but this did not help, they are not available further on. What do I have to do to import classes from external jars?
Best regards
Jens
Please sign in to leave a comment.
try to add your external jar as a classpath entry to your language (using language's property dialog).
surprisingly, generator module doesn't have the 'classpath' property - issue created: http://jetbrains.net/tracker/issue/MPS-3578
Hello Igor,
I did so, but I still can't use the classes from this jar. The ...@java_stub does not appear in the generator model/Model Properties/Imported Models/Add dialog, so I can't add them as shown in the calculator tutorial with javax.swing@java_stub, javax.swing.event@java_stub, java.awt@java_stub and javax.swing.text@java_stub models.
Best regards,
Jens
You should add your jars not to the classpath section but to the runtime classpath section instead. After that you will be able to use your java_stubs in a generator.
This works, thanks!
Best regards
Jens