Project

General

Profile

How to set the language level » History » Version 3

Henning Blohm, 13.05.2014 21:18

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 3 Henning Blohm
The system property, if set, must match either "6" or "7" at this time. 
12
13
Of course:
14
15
* Specifying a value of "7" while running under Java 6 will lead to compile errors!
16
* Trying to run with Java 7 source code under Java 6 will lead to compile errors.