Projects:Raise support to JDK11/Specs
Contents |
Functional Requirements
Overview
The minimum Java version to compile Openbravo is Java 8, dissallowing to compile any code that uses new functionality added in Java 9, 10 or 11. This project has the objective to raise this minimum Java version to Java 11.
Tasks
- Remove support for Java 8
- Raise minimum Java version to Java 11
Technical Requirements
Raising the stack requires some adjustment in different modules, tools, automated tasks and configuration files, those are explained here.
Backoffice
- Update Eclipse project configuration to use Java 11 for compilation.
- Update init ant tasks to use minimum Java 11 for compilation.
- Add example file with Java 11 only functionality for testing purposes.
- Update ECJ library in lib/runtime to be able to compile Jasper Report's jrxml with Java 11.
JavaDoc HTML flag
Since JDK 10, it is necessary to specify the html version that is used to generate the javadoc. There's a check in build.xml to add this flag only when using JDK 9+, because this feature doesn't exist on JDK8. The check can be removed and this flag(-html5) should always be added.
- Related issue adding this tag: https://issues.openbravo.com/view.php?id=38630
- Also update the HTTP link to Oracle's JavaDoc API Documentation.
Jasper Reports
Jasper Reports library compiles .jrxml using ECJ(Eclipse's compiler for Java). The maximum version supported in Backoffice seems to be Java 5 with the library jasperreports version 6.0, because this is the default properties and there's no property file modifying them. That means, Lambdas(from Java 8) and any new Language feature added after Java 5 are not supported without a properties file.
- Update ECJ to ecj-4.17(current latest version)
- Create a test case that uses Java 11 Language Features. (Usage of var local variables in lamda should be enough)
- Create a jasperreports.properties file to set the desired source + target for jasperreports to Java 11. (By default is Java 5) Add this file to .classpath.
- Related link with more info: https://community.jaspersoft.com/questions/1018456/use-lamda-expression-jrxml-file-jasper-report
Modules
- Remove all usage of deprecated methods/classes that where deprecated in Java 9, 10 or 11.
Backoffice Test
- Update Eclipse project configuration to use Java 11 for compilation.
Mobile Test
- Update Eclipse project configuration to use Java 11 for compilation.
DBSM
- Update build.xml to use Java 11 instead of Java 8 as minimum for compilation.
- Recompile java.japi.gz with Java 11 and push it when the stack is raised.
- Update jobs in CI to use the same Java 11 version for API-checks.
- Don't use min Java 11 for Emergency Releases 20Q2, 20Q3 and 20Q4(those still support Java 8)
Remove libraries colliding with JDK
- Remove all libraries that have a split package problem, as this makes Eclipse's compiler fail.
- Related tracking issue: https://issues.openbravo.com/view.php?id=44733
- Tool to check possible split packages: https://gitlab.com/openbravo/tools/platform/jar-collision-finder
Hardware Manager
It supports Java 8 right now, and it should be consistent with the raise in stack done in this project.
- Update stack for HW manager to Java 11
- Check how/where to get Java 11+ on Windows, as the main one (free Oracle) is forbidden for "Commercial Use".
- Update documentation on page: http://wiki.openbravo.com/wiki/Retail:Hardware_and_Peripherals_Guide
- Clean/fix deprecated warnings from sources.
- Check Eclipse's warnings and fix most of them.
Eclipse Warnings
This is a job that is executed in CI to check the possible warnings/errors thrown by the ECJ(Eclipse's compiler for Java).
- Remove hardcoded Java 8 and instead execute with the currently used Java version.