Hi can any body help me to start rmiregistry from the java program itself.
I does not want to start that from command prompt...
Printable View
Hi can any body help me to start rmiregistry from the java program itself.
I does not want to start that from command prompt...
why it doesn't start from command prompt? u can do a little bat file
not sure =p it opens rmiregistry but i think u need to be first in your class directory. i don't remember.Code:cd %Path to your classes%
"%JAVA_HOME%\bin\rmiregistry.exe"
pause
Code:Runtime r = Runtime.getRuntime();
Process p = null;
int pos = System.getProperty("java.home").lastIndexOf("\\");
String tempPath = System.getProperty("java.home").substring(0, pos) + "/bin/";
String cmd[] = {tempPath + "\\rmiregistry"};
try {
p = r.exec(cmd);
p.waitFor();
} catch (IOException e1) {
// do something
} catch (InterruptedException e2) {
// do something
}