Admin exception with getJavaVersions() in overview.cfm and new major JDK

Description

server.java.version only returns major release for brand new major Java JDKs.
(Ex. OpenJDK 14+36 only returns "14")
This causes return verArr[2] in overview.cfm to error. Needs to be in else{}.

Environment

None

Activity

Show:
KabutoTX
October 28, 2020, 9:14 PM

See my 3rd comment. The problem is only with the early release of OpenJDK 16. It appends "-ea" to the version, so you get "16-ea" as the first parameter. The fix is either my 3rd comment or Ryan's PR. Either will work.
This only applies to pre-release JDK versions. Attached is my Java test program that gets all the version info for newer JDK.

Pothys - MitrahSoft
October 29, 2020, 1:35 PM

, Yeah maybe your PR fixed the error.
But, I didn't see any error on the overview page and my above comment is only for the java version as showing full on the overview page. Now there is only part of the java version is showing. Seems the java version 14 instead of showing 14+36.

Ryan Stille
October 29, 2020, 7:27 PM

Maybe we need a new ticket? This ticket seems to be describing a problem with server.java.version. That is not the problem I encountered (an exception in the Lucee admin) and it’s not what my PR is trying to fix. My PR is trying to fix a problem where if you attempt to run Lucee on a version of Java that returns an “odd” value for it’s version (such as “16-ea”) then you cannot access the Lucee admin because the getJavaVersion function encounters an error.

KabutoTX
October 29, 2020, 7:45 PM
Edited

No were talking the same thing. My closed PR didn’t fix the problem. I was thinking Lucee was doing something else causing the error. Ignore my closed PR.

This is a bug ONLY running JDK 16 pre-release (or maybe under other JDK pre-releases).

getJavaVersion() in Admin’s overview.cfm calls server.java.version to get a major version number for the if() version check ONLY. It is not for display (that I know of).
In JDK 16 pre-release, server.java.version is “16-ea”. The “-ea” causes the exception. It needs to be a number.

JDK 14+36 is “14” which is correct and works fine. Everything but pre-release JDKs work fine.

So either the below or Ryan’s PR doing val() works in overview.cfm.

Ryan Stille
November 10, 2020, 6:59 PM

is there anything I can do to help move this forward? Your comment about

Now there is only part of the java version is showing. Seems the java version 14 instead of showing 14+36.

I don’t think that is related to the issue I’m addressing here. My code is only used to show #stText.Overview.warning.Java7NotSupport#, it’s not used to show a java version anywhere.

Assignee

Michael Offner

Reporter

KabutoTX

Priority

New

Labels

None

Fix versions

None

Affects versions

Configure