java - Running second code(jar) from one's jar main class -



java - Running second code(jar) from one's jar main class -

what need run jar file within jar file java code. have turnoffclient.jar file set in chatsystemclient.jar file , want execute(start,run) turnoffclient.jar file xclient.jar main-class code. have tried:

runtime.getruntime().exec(this.getclass().getresource("/jars/turnoffclient.jar").tostring());

also:

turnoffclient.main(args);

it seems work when close first java application sec 1 closes too,which don't want. directories: https://imagizer.imageshack.us/v2/253x254q90/856/ztuz.png

this bad programming practice, instead create new class calls both programs.

example:

program a; programme b; a.run(); while(a.isalive()){ if( /*we need run programme b*/){ b.run(); break; } }

java jar executable-jar

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -