javac -source and -target command options

Hello Web-CAT community,

I'm using the main Web-CAT server, which is currently running Java 1.8.

I'd like to have my student submissions run with Java version 1.7.

Is there some feature of Web-CAT that lets me (or students) specific -source

and -target command options to the compiler?






Stephen Edwards

There is no option for this

There is no option for this right now.  The main problem is that each Java version also comes with a different runtime library.  So switching to source/target Java 1.7 also requires there to be a 1.7 version of the runtime available in order to be fully compatible, and it is necessary to configure the bootclasspath as well.  Since the server does not have multiple alternative JVM versions installed, this is a bit tricky to do.  It could be turned into an option by someone suitably motivated, but so far there hasn't been any strong need.

Out of curiosity, do you want to specify the Java version to prevent students from using specific 1.8 syntax features?  Or are you trying to maintain compatibility with a textbook or something?


re: There is no option for this

"prevent students from using specific 1.8 syntax features"

Yes, this.

It's not really important, I'll just proceed with 1.8.

Thanks for explaining.