Bug 244634 - java/openjdk8: Incorrect VM vendor advertised
Summary: java/openjdk8: Incorrect VM vendor advertised
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: freebsd-java (Nobody)
Depends on:
Reported: 2020-03-06 16:36 UTC by Michael Osipov
Modified: 2020-07-13 05:30 UTC (History)
4 users (show)

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

Patch against /usr/ports (1.45 KB, patch)
2020-03-06 16:36 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 Michael Osipov 2020-03-06 16:36:17 UTC
Created attachment 212193 [details]
Patch against /usr/ports

The current version advertises:

> java.vm.vendor=Oracle Corporation
> java.vendor.url=http://java.oracle.com/
> java.vendor=Oracle Corporation
> java.vendor.url.bug=http://bugreport.sun.com/bugreport/

But this OpenJDK distribution is not from Oracle, its it from the FreeBSD-derived AdoptOpenJDK distribution.

As a comparison, this is what Azul Zulu prints:

> java.vm.vendor=Azul Systems, Inc.
> java.vendor.url=http://www.azulsystems.com/
> java.vendor=Azul Systems, Inc.
> java.vendor.url.bug=http://www.azulsystems.com/support/

Attached is a patch which advertises that this OpenJDK distro comes from the Free BSD Project.

The same can be applied to all other OpenJDK ports.
Comment 1 Michael Osipov 2020-03-15 21:02:40 UTC
I just have noticed:
> $ make java-debug | grep JAVA_PORT_VENDOR
> JAVA_PORT_VENDOR=               openjdk (OpenJDK BSD Porting Team)

They should be consistent.
Comment 2 Tommy P 2020-03-16 04:32:50 UTC
Does it matter what is advertised for the vendor? I thought as long as the JDK adheres strictly to the JSR, it should be OK.

Below is what Tomcat 9.0.31 showing the JVM for Ubuntu 18.04.x LTS via the manager-gui:

Version: 11.0.6+10-post-Ubuntu-1ubuntu118.04.1
Vendor: Ubuntu
OS Name: Linux
OS Version: 4.15.088-Generic.
Comment 3 Michael Osipov 2020-03-16 08:22:04 UTC
(In reply to Tommy P from comment #2)

It actually does.

* For constructs like this https://sourceforge.net/p/wrapper/bugs/313/
* For assumptions about the features of a VM. E.g, SapMachine provides features other VMs don't.
* Legal reasons, you can't call it Java if you are not Oracle
* Marketing and support reasons
Comment 4 Greg Lewis freebsd_committer 2020-06-08 06:18:11 UTC
It's reasonable that we should change this.  I'd like to give some thought as to what it should say though.  The port is a separate group from the FreeBSD project, so I'm not sure that FreeBSD is the right choice here.
Comment 5 Michael Osipov 2020-06-08 07:11:32 UTC
What about witht the original AdoptOpenJDK label + "(BSD port)" or similar?
Comment 6 commit-hook freebsd_committer 2020-07-12 01:03:48 UTC
A commit references this bug:

Author: glewis
Date: Sun Jul 12 01:03:36 UTC 2020
New revision: 542061
URL: https://svnweb.freebsd.org/changeset/ports/542061

  More accurate vendor information

  I've tweaked the values suggested in the PR patch.

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

Comment 7 commit-hook freebsd_committer 2020-07-12 02:14:02 UTC
A commit references this bug:

Author: glewis
Date: Sun Jul 12 02:13:28 UTC 2020
New revision: 542063
URL: https://svnweb.freebsd.org/changeset/ports/542063

  More accurate vendor information

  PR:		244634

Comment 8 Michael Osipov 2020-07-12 07:59:15 UTC
Thanks for the fix. Can you explain why you did not put AdoptOpenJDK into the name although this is a fork of it?
Comment 9 Greg Lewis freebsd_committer 2020-07-12 17:13:25 UTC
Because none of the AdoptOpenJDK specific code is used
Comment 10 Michael Osipov 2020-07-12 17:18:02 UTC
(In reply to Greg Lewis from comment #9)

Thanks, this is still a fork of AdoptOpenJDK, isn't it?
Comment 11 Greg Lewis freebsd_committer 2020-07-12 18:18:57 UTC
AdoptOpenJDK is a mirror of the official Mercurial repos.  There are some AdoptOpenJDK specifics on the dev branch, which are not used at all by the BSD port.  So there is is nothing AdoptOpenJDK specific in the code at all.
Comment 12 Michael Osipov 2020-07-12 19:05:10 UTC
(In reply to Greg Lewis from comment #11)

Thanks for the enlightment, I was not aware of this fact!
Comment 13 Stefan Ehmann 2020-07-12 21:34:53 UTC
Is the missing space before the "(build [...]" intentional?

$ java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (OpenJDK BSD Porting Team)(build 1.8.0_252-b09)
OpenJDK 64-Bit Server VM (OpenJDK BSD Porting Team)(build 25.252-b09, mixed mode)

This change breaks java/openjfx8-devel which checks for " (build" (including the space) in build.gradle for some reason.
Comment 14 Michael Osipov 2020-07-12 21:55:45 UTC
(In reply to Stefan Ehmann from comment #13)

I consider this to be a bug in the native launcher. The 11 launcher does not print this value at all.
Comment 15 Michael Osipov 2020-07-12 22:03:33 UTC
HEre is Zulu example on Windows:

C:\Users\osipovmi>java -version
java version "1.8.0_251"
Java(TM) SE Runtime Environment (build 1.8.0_251-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)

C:\Users\osipovmi>mvn -v
Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T20:33:14+02:00)
Maven home: C:\Entwicklung\Programme\apache-maven-3.5.4\bin\..
Java version: 1.8.0_252, vendor: Azul Systems, Inc., runtime: C:\Program Files\Zulu\zulu-8\jre
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

So this value should be removed actually from the launcher and solely relied on the VM vendor property.
Comment 16 Michael Osipov 2020-07-12 22:20:04 UTC
Here it is, the bug from less ./build/bsd-x86_64-normal-server-release/jdk/gensrc/sun/misc/Version.java:

> ps.print(java_runtime_name + " " + company_name + "(build " + java_runtime_version);

>     private static final String company_name =
>        "(OpenJDK BSD Porting Team)";

> common/autoconf/jdk-options.m4:  elif test "x$with_company_name" != x; then
> ./common/autoconf/jdk-options.m4:    COMPANY_NAME="$with_company_name"
> ./jdk/make/gensrc/GensrcMisc.gmk:company_name =
> ./jdk/make/gensrc/GensrcMisc.gmk:  company_name=($(COMPANY_NAME))
> ./jdk/make/gensrc/GensrcMisc.gmk:           -e 's/@@company_name@@/$(company_name)/g' \
> ./jdk/src/share/classes/sun/misc/Version.java.template:    private static final String company_name =
> ./jdk/src/share/classes/sun/misc/Version.java.template:        "@@company_name@@";

In 11 src/java.base/share/classes/java/lang/VersionProps.java.template is used which does not have java.vm.vendor printed.
Comment 17 commit-hook freebsd_committer 2020-07-13 05:30:02 UTC
A commit references this bug:

Author: glewis
Date: Mon Jul 13 05:29:34 UTC 2020
New revision: 542112
URL: https://svnweb.freebsd.org/changeset/ports/542112

  Don't print the company name in the version info

  This evidently breaks some software that does parsing of -version output

  PR:		244634
  Submitted by:	Stefan Ehmann <shoesoft@gmx.net>