简体   繁体   中英

how would i compile and execute a java program in a scala program?

So im trying to test two java programs and if they have the same output, and I want to do this within scala. So how would i do this within scala, should i use the java runtime library or is there one in scala?

You can use the JavaCompiler API . Or, simpler, just run javac in an external process, as @zapl's comment says.

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