I have an Eclipse plugin project, and it depends on other projects that I have in my Eclipse workspace. After adding the project dependencies under \"Java Build Path\" -> \"
In case if you're not in a position to copy the dependent project into your plugin project and you are sure about the presence of the dependent project in the target eclipse where plugin is to be installed, then you can either use
Runtime.exec()
to run the Java class you want to run or ProcessBuilder
class to run the class.
Like this:
// To compile
Process p = Runtime.getRuntime().exec("javac yourclass.java");
// To execute
Process p2 = Runtime.getRuntime().exec("java yourclass");
This may be considered in the worst case. I had such an experience and hence thought some may find it useful.