简体   繁体   中英

Create a jar file for application to run

I have two projects, one which generates messages and sends them to the server via socket connection, and another project which sits server side, and consumes the messages and sends them to a queue. Is there anyway, rather than start the sender project first then start my server side project, export the first to a jar file and then somehow invoke the jar file and get it to start sending?

Thanks

如果您想通过代码调用jar文件,就是这样-

Process p = Runtime.getRuntime().exec("cmd /c java -jar another.jar");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM