Project

General

Profile

How to set the language level » History » Version 2

Henning Blohm, 13.05.2014 13:22

1 2 Henning Blohm
h1. How to set the language level (#1029)
2 1 Henning Blohm
3
Z2 compiles Java code (using a built-in Eclipse Java Compiler). Typically, you do not need to worry about language levels, as by default, Z2 simply sticks to the version of the Java Development Kit (or Java Runtime Environment) it is currently executed with.
4
5
That is, if you run a Java 6 JDK, then Z2 will compile for Java 6, if you run a Java 7 JDK, Z2 will compile for Java 7. 
6
7
Note that Java 8 is not supported at the time of writing.
8
9
The language level used by the compiler can however be specified using the system property *com.zfabrik.java.level*.
10
11
The system property, if set, must match "6" or "7" at this time. Speficying a value of "7" while running under Java 6 will lead to runtime errors!