This is fairly simple in Windows, but a little tricky in Linux. I am using
Runtime.getRuntime().exec(new String[] { "/bin/bash", "-c", "java -classpath /home/4/byz/Orc" });
where Orc is the class file with a main function. But nothing happens. Are there any settings ? Am I doing something wrong ?
I wish the java program to run in the terminal.
EDIT
Here is the solution:
String[] cmdArray = {"gnome-terminal","java -classpath /home/r/byz/ Orchestrator"};
try {
Runtime.getRuntime().exec(cmdArray);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
So basically, we have to use gnome-terminal ..
java -classpath /home/4/byz/Orcis incomplete. If you want to run a java Class, you will have to mention that at the end ofjavacommand. Did you try something likejava -classpath $CLASSPATH:/home/4/byz/ Orc- note the space beforeOrcOrcfrom commandline?cd byzand then I am doingr@r-desktop:~/byz$ java Orcjava -classpath /home/r/byz Orc