Will Spoofax Core have the compile and run features for the Java language?

Currently I’m invoking javac and java with:

(exitCode, output) := <call-read-output> ("javac", ["-cp", <dirname>$[[project-path]/[javaFileName]], javaFileName]);

(exitCode, output) := <call-read-output> ("java", ["-cp", classPath, className])

But with the pre-packaged Eclipse installs containing a JRE I get a Java version exception java.lang.unsupportedclassversionerror unsupported major.minor version 52.0 as the included Java is a different version (1.7?) than the one on my machine (1.8).

If we would support compile and run for Java as language features we can avoid these issues.

Submitted by Daco Harkes on 4 September 2015 at 09:55

On 4 September 2015 at 17:20 Gabriël Konat commented:

Nope, this is more of a Stratego issue. You can create a Java external strategy or primitive that runs and compiles Java code and use that instead. We can include such a primitive in Spoofax core of course :)

Where do you exactly get that error? If you compile something with JDK 8, you cannot run it with JRE 7 by default. You can pass the -target 1.7 option to javac to target JRE 7 and up.


On 15 September 2015 at 18:06 Gabriël Konat closed this issue.

Log in to post comments