Alan Liang
Alan Liang

Reputation: 17

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?

Upvotes: 0

Views: 320

Answers (1)

Alexey Romanov
Alexey Romanov

Reputation: 170735

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

Upvotes: 1

Related Questions