I'm trying to run the jhipster import-jdl command from a java program as show below.
public boolean generate(String foldername, String filename) {
Runtime rt = Runtime.getRuntime();
try {
IPath root = ResourcesPlugin.getWorkspace().getRoot().getLocation();
Process proc = rt.exec(new String[] { "cmd", "/K",
"cd " + root + "\\" + foldername + " && jhipster import-jdl " + filename });
}
catch (IOException e) {
e.printStackTrace();
}
return true;
}
But the entity files are not getting created.
But if I open the command prompt in the folder specified in the code and run the same command as shown below manually, the entity files are generated.
cd C:\GitClone\work && jhipster import-jdl swaggertest.jh
I'm new to these things and have no idea on where am I going wrong. Please help me with the same.