Bug 213080 - java/openjdk7: JavaScript engine not included and other ports affected
Summary: java/openjdk7: JavaScript engine not included and other ports affected
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Greg Lewis
Depends on:
Reported: 2016-09-29 11:49 UTC by Michael Osipov
Modified: 2019-10-08 08:05 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (glewis)


Note You need to log in before you can comment on or make changes to this bug.
Description Michael Osipov 2016-09-29 11:49:07 UTC
$ uname -rK
9.3-STABLE 903511

$ /usr/local/openjdk7/bin/jrunscript -q


$ /usr/local/openjdk8/bin/jrunscript -q
Language ECMAScript ECMA - 262 Edition 5.1 implementation "Oracle Nashorn" 1.8.0_102

Version 7 does not have Nashorn installed/bundled. This causes runtime errors. E.g., port sysutils/javaservicewrapper has JAVA_VERSION=1.4+ and requires JavaScript to run some tests. If you have only OpenJDK7 installed, tests will fail instantly.

Either check wether the distro includes Nashorn or opt-in to use Rhino if not possible.

Similar reports:
Comment 1 Michael Osipov 2016-09-29 11:55:06 UTC
$ /usr/local/openjdk7/bin/java -version
openjdk version "1.7.0_111"
OpenJDK Runtime Environment (build 1.7.0_111-b01)
OpenJDK Server VM (build 24.95-b01, mixed mode)
Comment 2 Greg Lewis freebsd_committer 2017-11-23 17:57:35 UTC
The OpenJDK7 doesn't include Nashorn.  It seems like support for Rhino could be made to work, but this is lower priority than getting Java9 working (IMO).
Comment 3 Michael Osipov 2017-11-23 18:56:19 UTC
(In reply to Greg Lewis from comment #2)

fully agree
Comment 4 Walter Schwarzenfeld freebsd_triage 2018-02-27 19:56:06 UTC
Comment 5 Greg Lewis freebsd_committer 2018-03-04 17:41:17 UTC
At this point I'm willing to accept patches for this but have no plans to work on it directly.
Comment 6 Michael Osipov 2018-03-04 18:05:49 UTC
(In reply to Greg Lewis from comment #5)

I'll have a look at it. Though, can't promise any timeframe. I'd rather see Java 11 on FreeBSD.

Thanks Greg!
Comment 7 Michael Osipov 2018-03-04 21:14:37 UTC
(In reply to Greg Lewis from comment #5)

So, I have something working, but do not know how to properly fix the port:

1. java.vendor "Oracle Corporation" has to be removed because OpenJDK comes from Oracle, but does not include a JS engine
2. build-tests.xml requires in ${basedir}/external/test/scriptLibs with bsf.jar, commons-logging.jar and rhino.jar. While the last two are in ports, bsf is no and I don't really want maintain a port for ancient stuff.
3. Lines referencing these JARs need to be rewritten in post-patch within an if clause.

Comment 8 Michael Osipov 2019-10-08 08:05:07 UTC
openjdk7 is set to expired. No need to fix this anymore.