Created attachment 220535 [details] Force set java version to 8 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=251774 "Mk/bsd.default-versions.mk: Change default version of Java to 11" Doesn't build with DEFAULT_VERSIONS+= java=11 even with JAVA_BUILD=8 it trying use OpenJDK 11: # make ===> License APACHE20 accepted by the user ===> bsh-2.0.b6_1 depends on file: /usr/local/sbin/pkg - found ===> Fetching all distfiles required by bsh-2.0.b6_1 for building ===> Extracting for bsh-2.0.b6_1 => SHA256 Checksum OK for beanshell-beanshell-2.0b6_GH0.tar.gz. ===> Patching for bsh-2.0.b6_1 ===> bsh-2.0.b6_1 depends on file: /usr/local/openjdk11/bin/java - found ===> bsh-2.0.b6_1 depends on file: /usr/local/bin/ant - found ===> Configuring for bsh-2.0.b6_1 ===> Building for bsh-2.0.b6_1 Buildfile: /tmp/work/usr/ports/lang/bsh/work/beanshell-2.0b6/build.xml checkjjt: jjtree: checkjj: javacc: builddir: [mkdir] Created dir: /tmp/work/usr/ports/lang/bsh/work/beanshell-2.0b6/classes compile: [javac] /tmp/work/usr/ports/lang/bsh/work/beanshell-2.0b6/build.xml:176: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds [javac] Compiling 155 source files to /tmp/work/usr/ports/lang/bsh/work/beanshell-2.0b6/classes [javac] [javac] WARNING [javac] [javac] The -source switch defaults to 9 in JDK 9. [javac] If you specify -target 1.5 you now must also specify -source 1.5. [javac] Ant will implicitly add -source 1.5 for you. Please change your build file. [javac] warning: [options] bootstrap class path not set in conjunction with -source 5 [javac] error: Source option 5 is no longer supported. Use 6 or later. [javac] error: Target option 1.5 is no longer supported. Use 1.6 or later. BUILD FAILED /tmp/work/usr/ports/lang/bsh/work/beanshell-2.0b6/build.xml:176: Compile failed; see the compiler error output for details. Total time: 1 second *** Error code 1 Stop. make: stopped in /usr/ports/lang/bsh This patch fixed build: # diff -u Makefile.orig Makefile --- Makefile.orig +++ Makefile @@ -15,8 +15,7 @@ GH_ACCOUNT= beanshell GH_PROJECT= beanshell -USE_JAVA= yes -JAVA_BUILD= 8 +USE_JAVA= 8 USE_ANT= yes ALL_TARGET= jarall
It is a well known fact that the port only builds with Java 8 and that's why the port specifies: JAVA_BUILD= 8 Upstream's version in github builds and works fine with newr Java but there is no official release.
A commit references this bug: Author: pfg Date: Mon Dec 14 02:11:04 UTC 2020 New revision: 558070 URL: https://svnweb.freebsd.org/changeset/ports/558070 Log: lang/bsh: Use JDK 8. It is well known this port requires Java 8 to build. Use Java 8 explicitly so setting the default to another version doesn't break it. PR: 251824 Approved by: thierry (mentor, implicit) Changes: head/lang/bsh/Makefile
Committed, thanks!
(In reply to Pedro F. Giffuni from comment #1) > It is a well known fact that the port only builds with Java 8 and that's why the port specifies: > JAVA_BUILD= 8 But this doesn't work as expected. :-( > Upstream's version in github builds and works fine with newr Java but there is no official release. Ye, I checked upstream before create this PR: they have several old and new bug reports with questions and suggestions about new release - or at least create tag 3.0 alpha 1. Maybe update to last commit? Don't know is it good idea or not… > Committed, thanks! Thank you for fast commit!
(In reply to VVD from comment #4) JAVA_BUILD=8 worked for a while, I have no idea why it stopped working. I am involved in the beanshell project, unfortunately no one seems to have gathered the courage to do a new release. Plus we all have a serious lack of time.
After https://svnweb.freebsd.org/ports?view=revision&sortby=date&revision=559045 got error: [javac] /tmp/work/usr/ports/lang/bsh/work/beanshell-2.1.0/src/bsh/util/AWTConsole.java:217: error: cannot find symbol [javac] ((java.awt.peer.TextComponentPeer)getPeer()).setCaretPosition( [javac] ^ [javac] symbol: method getPeer() [javac] location: class AWTConsole
A commit references this bug: Author: pfg Date: Thu Dec 24 20:51:12 UTC 2020 New revision: 559189 URL: https://svnweb.freebsd.org/changeset/ports/559189 Log: lang/bsh: use Java 8 While 2.1.0 is an improvement it still doesn't include all the fixes for deprecated APIs in JDK 11+. Upstream's master branch does much better but there is no easy patch, so set JDK to 8 for now. PR: 251824 Approved by: thierry (mentor, implicit) Changes: head/lang/bsh/Makefile
(In reply to VVD from comment #6) Thanks for reporting. Unfortunately there is no easy fix at this time, although upstream did solve the issue.