You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Java 21 for OH5 development
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
* rework after OH5 release
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
* review comment
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
---------
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
Copy file name to clipboardExpand all lines: configuration/blockly/index.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ Important: For Blockly to work, you need to have the [Javascript Scripting Addon
44
44
### openHAB 3 / openHAB 4 to openHAB 4.3 or Later - Migration
45
45
46
46
From openHAB 4 onwards, the script engine is GraalJS provided by the [JS Scripting Addon](https://www.openhab.org/addons/automation/jsscripting/), **ECMAScript 2022**, when Blockly creates new scripts.
47
-
OpenHAB versions before 4.3 could use **ECMAScript 2022** or **NashornJS** with **ECMAScript 5.1**, either installed by default or installed through an Addon.
47
+
openHAB versions before 4.3 could use **ECMAScript 2022** or **NashornJS** with **ECMAScript 5.1**, either installed by default or installed through an Addon.
48
48
**NashornJS** is no longer an option with openHAB 4.3 or later. Therefore the generated Blockly code needs to be converted to **ECMAScript 2022**.
49
49
50
50
Converting is as easy as making sure the [JS Scripting Addon](https://www.openhab.org/addons/automation/jsscripting/) is installed, and opening your Blockly script.
Copy file name to clipboardExpand all lines: configuration/migration/index.md
+2
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,8 @@ You should probably do your usual OS backup too to make sure you can get back to
46
46
47
47
openHAB (since version 4) requires Java 17. Most modern Linux OS have an `openjdk-17-jdk` package available for you to install but alternative solutions such as [Zulu's OpenJDK](https://www.azul.com/downloads/zulu-community/?version=java-17-lts&package=jdk) (which openHABian can install for you) are available and these may run faster on 32-bit armhf platforms such as the Raspberry Pi.
48
48
49
+
openHAB 5 development requires Java 21.
50
+
49
51
You must also be on the relevant repository for openHAB, this hasn't changed for openHAB 4.x so the [same instructions for moving to it](https://www.openhab.org/docs/installation/linux.html#package-repository-installation) are still valid.
50
52
51
53
For DEB based installers (apt), your `.list` file should contain the line:
Copy file name to clipboardExpand all lines: developers/index.md
+3-6
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Try [git - the simple guide](https://rogerdudler.github.io/git-guide/) as a star
16
16
Add-ons and the openHAB core itself are written in Java.
17
17
Java is not hard to learn, but it helps if you have a general technical understanding of programming languages.
18
18
19
-
The different guides of this chapter assume that you are somewhat familiar with Java 17 and that you have a rough understanding of Git's workflow (e.g. "checkout", "branches", "push").
19
+
The different guides of this chapter assume that you are somewhat familiar with Java 21 and that you have a rough understanding of Git's workflow (e.g. "checkout", "branches", "push").
20
20
21
21
## Choose the Right Concept
22
22
@@ -49,13 +49,10 @@ Please ensure that you have the following prerequisites installed as well:
49
49
50
50
1.[Git](https://git-scm.com/downloads) For retrieving our source code and push changes back. On Windows: Must be available in %PATH%
51
51
1.[Maven 3.x](https://maven.apache.org/download.cgi) Our build system tool. On Windows: Must be available in %PATH%
52
-
1. Java JDK 17 or JDK 21, for example from Oracle[Oracle JDK 17](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) or[Oracle JDK 21](https://www.oracle.com/java/technologies/javase/jdk21-archive-downloads.html). On Windows: %JAVA% must be set.
52
+
1. Java JDK 21, for example from Oracle [Oracle JDK 21](https://www.oracle.com/java/technologies/javase/jdk21-archive-downloads.html). On Windows: %JAVA% must be set.
53
53
54
54
::: tip Note
55
-
Whereas we recommend Java 17 for running openHAB, development can be safely done on Java 21.
56
-
With default settings, the Java 21 compiler will generate Java objects compatible with JRE 17.
57
-
If you run your openHAB server on Java 21, you can enable native Java 21 objects by adding `-Pj21` to the Maven command line.
58
-
Note that our CI checks Java 17 and Java 21 compatibility, and we only use language features available in Java 17.
55
+
Whereas openHAB 4.x series was based on Java 17, starting with openHAB 5.0.0-SNAPSHOT, **Java 21 is required**.
59
56
:::
60
57
61
58
You can use any IDE that is suitable for OSGi/Java development.
Copy file name to clipboardExpand all lines: installation/synology.md
+2-1
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,8 @@ title: Synology DiskStation
5
5
6
6
:::tip Note
7
7
8
-
openHAB 4 and higher need Java 17.
8
+
openHAB 4.x series requires Java 17.
9
+
Java 21 can be used openHAB 4.x, and is required for openHAB 5.
9
10
You will need to provide a working Java installation on your DiskStation.
10
11
The sections below are written for Java 11 but the docs are not updated currently, since we have not secured knowledge about how to install Java 17 on the DiskStation.
11
12
If you can provide some proper sources and explanation, we are happy to include your contribution into this article.
Copy file name to clipboardExpand all lines: installation/windows.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ Please be sure you have installed the required supporting applications as descri
19
19
20
20
### Set the `JAVA_HOME` System Environment Variable in Windows
21
21
22
-
Note: If you have installed Zulu Java 17 (highly recommended for OH 4.x) you may skip this step because the JAVA_HOME environment variable was created during installation.
22
+
Note: If you have installed Java 17 (recommended for OH 4.x) or Java 21, you may skip this step because the JAVA_HOME environment variable was created during installation.
23
23
24
24
- Navigate to: Control Panel ➡️ System and Security ➡️ System ➡️ Advanced System Settings ➡️ Environment Variables ➡️ System Variables
25
25
- Create a New System Variable named JAVA_HOME (or update the existing one) to match the installation directory of the Java Platform chosen and installed in the step [Prerequisites]({{base}}/installation/index.html#prerequisites).
0 commit comments