jtulach commented on a change in pull request #2761:
URL: https://github.com/apache/netbeans/pull/2761#discussion_r579981286
##########
File path: enterprise/web.monitor/build.xml
##########
@@ -27,7 +27,7 @@
<target name="compile-server" depends="init,compile">
<mkdir dir="build/server-classes"/>
- <javac srcdir="serversrc" destdir="build/server-classes"
deprecation="${build.compiler.deprecation}" debug="${build.compiler.debug}"
source="${javac.source}" includeantruntime="false">
+ <javac srcdir="serversrc" destdir="build/server-classes"
deprecation="${build.compiler.deprecation}" debug="${build.compiler.debug}"
source="${javac.source}" release="8" target="1.8" includeantruntime="false">
Review comment:
Your concern may be valid, but the actual problem is the opposite. Make
sure `nbjdk.home` isn't set and then try (on `12.3` without this PR):
```bash
enterprise/web.monitor$ JAVA_HOME=/jdk-8 ant clean compile-server
enterprise/web.monitor$ /jdk-11/bin/javap -v -cp build/server-classes/
org/netbeans/modules/web/monitor/server/Logger | grep -i Major -B 1
minor version: 0
major version: 52
```
e.g. in all version of Apache NetBeans up to 12.3 the http monitor could
only be executed on JDK8+. Now, try to compile on JDK11:
```bash
enterprise/web.monitor$ JAVA_HOME=/jdk-11 ant -Dpermit.jdk9.builds=true
clean compile-server
enterprise/web.monitor$ /jdk-11/bin/javap -v -cp build/server-classes/
org/netbeans/modules/web/monitor/server/Logger | grep -i Major -B 1
minor version: 0
major version: 55
```
See? If you compile on JDK11, the http monitor can only be executed on
JDK11! According to documentation of [Ant Javac
task](https://ant.apache.org/manual/Tasks/javac.html) it is highly desirable to
set `target` - which is what this PR does.
Btw. I have only discovered this problem by introducing the 1067e68 test.
E.g. the purpose of the `ValidateClassFilesTest` isn't to _bump the target up
to 1.8_, but prevent us to accidentally compile with _target higher than
expected_.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists