Bug 244776 - sysutils/javaservicewrapper: does not build with JDK 11
Summary: sysutils/javaservicewrapper: does not build with JDK 11
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Greg Lewis
URL:
Keywords: buildisok
Depends on:
Blocks:
 
Reported: 2020-03-12 21:06 UTC by Tommy P
Modified: 2020-06-14 01:22 UTC (History)
3 users (show)

See Also:
michael.osipov: maintainer-feedback+
michael.osipov: maintainer-feedback+


Attachments
Patch against /usr/ports (4.00 KB, patch)
2020-03-15 13:29 UTC, Michael Osipov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tommy P 2020-03-12 21:06:44 UTC
The port does not build with JDK 11:

compile-java:core:
    [mkdir] Created dir: /wrkdirs/usr/ports/sysutils/javaservicewrapper/work/wrapper_3.5.41_src/build/classes
    [mkdir] Created dir: /wrkdirs/usr/ports/sysutils/javaservicewrapper/work/wrapper_3.5.41_src/build/testclasses
    [mkdir] Created dir: /wrkdirs/usr/ports/sysutils/javaservicewrapper/work/wrapper_3.5.41_src/lib
    [javac] Compiling 108 source files to /wrkdirs/usr/ports/sysutils/javaservicewrapper/work/wrapper_3.5.41_src/build/classes
    [javac] warning: [options] bootstrap class path not set in conjunction with -source 1.4
    [javac] error: Source option 1.4 is no longer supported. Use 6 or later.
    [javac] error: Target option 1.4 is no longer supported. Use 1.6 or later.
-------------------------------------------------------
When patching the default.properties as below per Makefile's "USE_JAVA=       1.8+"

--- default.properties.ori      2020-03-12 20:53:43.795864000 +0000
+++ default.properties  2020-03-12 20:54:02.283785000 +0000
@@ -28,7 +28,7 @@
 junit.failonerror = true

 #  Minimum version of Java required to build the Wrapper
-javac.target.version=1.4
+javac.target.version=1.8

 #  Location of java to build the pre-release
 javac.dir=E:\\j2sdk1.4.2_19


This error is thrown:

BUILD FAILED
/wrkdirs/usr/ports/sysutils/javaservicewrapper/work/wrapper_3.5.41_src/build.xml:552: javah does not exist under Java 10 and higher, use the javac task with nativeHeaderDir instead


I've also tried with the latest 3.5.43 with same result.
Comment 1 Michael Osipov 2020-03-12 21:29:05 UTC
That's a good catch. Java version can be raised to 1.7 since we have openjdk7 too. As for the header files, yes. That is a pity with other projects too. I will take a look at this tomorrow and report also upstream. 

Stay tuned.
Comment 2 Michael Osipov 2020-03-12 23:03:35 UTC
Alright. The port is targeted for Java 1.8+ because Ant requires it. This means that we can ignore Java 7 (unfortunately). "javac -h" is already present in 8 so we don't need an if/else contruct. I will work on a decent patch tomorrow.
Comment 3 Michael Osipov 2020-03-13 21:05:56 UTC
I have now a patch locally. Going through

> poudriere testport -j 121-release-i386 -p dev -o sysutils/javaservicewrapper
> poudriere testport -j 121-release-amd64 -p dev -o sysutils/javaservicewrapper
> poudriere testport -j 113-release-i386 -p dev -o sysutils/javaservicewrapper
> poudriere testport -j 113-release-amd64 -p dev -o sysutils/javaservicewrapper

with Java 8, 11, 13.
Comment 4 Michael Osipov 2020-03-15 12:06:21 UTC
I have concluded my tests. Java 8 and 11 run fine now. Java 13 jail causes some pkg-plist failures, but the pure compilation is not affected. This could be some Ant issue. I will update the patches shortly.
Comment 5 Michael Osipov 2020-03-15 13:29:29 UTC
Created attachment 212424 [details]
Patch against /usr/ports

Here is a patch. Please try. Works for me in

poudriere testport -j 121-release-i386 -p dev -o sysutils/javaservicewrapper -z java8
poudriere testport -j 113-release-i386 -p dev -o sysutils/javaservicewrapper -z java8
poudriere testport -j 121-release-amd64 -p dev -o sysutils/javaservicewrapper -z java8
poudriere testport -j 113-release-amd64 -p dev -o sysutils/javaservicewrapper -z java8
poudriere testport -j 121-release-i386 -p dev -o sysutils/javaservicewrapper -z java11
poudriere testport -j 113-release-i386 -p dev -o sysutils/javaservicewrapper -z java11
poudriere testport -j 121-release-amd64 -p dev -o sysutils/javaservicewrapper -z java11
poudriere testport -j 113-release-amd64 -p dev -o sysutils/javaservicewrapper -z java11

Note that setting JAVA_VERSION in make.conf has only effect if and only if JAVA_VERSION is removed from port's Makefile.
Comment 6 Michael Osipov 2020-03-15 21:01:18 UTC
I have also found the issue why it fails with Java 12+. It is caused by 244634 from Java 12+.
Comment 7 Tommy P 2020-03-16 04:24:47 UTC
(In reply to Michael Osipov from comment #5)
Hi Michael,

It works great!  Thanks for fixing it and updating to current.

Best regards,
Tommy
Comment 8 Michael Osipov 2020-03-16 08:24:43 UTC
Port commiters, please apply this patch and bump port revision.

I will work on the Java version issue in a separate ticket.
Comment 9 Automation User 2020-05-18 00:20:28 UTC
Build info is available at https://gitlab.com/swills/freebsd-ports/pipelines/146946211
Comment 10 Greg Lewis freebsd_committer freebsd_triage 2020-06-08 06:19:40 UTC
Thanks for working on this Michael.  I'll aim to get this committed this week.
Comment 11 commit-hook freebsd_committer freebsd_triage 2020-06-14 01:22:03 UTC
A commit references this bug:

Author: glewis
Date: Sun Jun 14 01:21:50 UTC 2020
New revision: 538710
URL: https://svnweb.freebsd.org/changeset/ports/538710

Log:
  Fix the build with newer versions of Java

  PR:		244776
  Submitted by:	Michael Osipov <michael.osipov@siemens.com>

Changes:
  head/sysutils/javaservicewrapper/Makefile
  head/sysutils/javaservicewrapper/files/
  head/sysutils/javaservicewrapper/files/patch-build.xml