tags:

views:

50

answers:

1

I have a problem with running a Java app (B) from my app (A). Code I use:

String[] cmd = {"/bin/sh", "-c", "java -Xmx16M -Xms2M -cp /root/ " + B + "> output.data"};
Runtime rt = Runtime.getRuntime();
final Process proc = rt.exec(cmd);
Thread.sleep(1000);
proc.destroy();

I must stop app (B) from accessing my disk (write/read). How to do so?

+3  A: 

This is possible by using a security manager as described in the Java tutorials.

Michael Borgwardt
Thx, that was exactly what i was looking for ! :)
tzim