Bug 550831 - IVMInstall2 and IVMInstall3 report different java.version values
Summary: IVMInstall2 and IVMInstall3 report different java.version values
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.12   Edit
Hardware: PC Windows 10
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-06 04:58 EDT by Bence Sipka CLA
Modified: 2023-08-21 04:05 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bence Sipka CLA 2019-09-06 04:58:33 EDT
The IVMInstall2 and IVMInstall3 interfaces report different java.version property values when queried.

Given the following code:

for (IVMInstallType vmitype : JavaRuntime.getVMInstallTypes()) {
	for (IVMInstall install : vmitype.getVMInstalls()) {
		//returns jdk1.8.0_221
		install.getName();
		//returns 1.8.0
		((IVMInstall2)install).getJavaVersion();
		//returns: {java.version=1.8.0_221}
		((IVMInstall3)install).evaluateSystemProperties(new String[] {"java.version"}, null);
	}
}

You can see that while the getJavaVersion() function returns "1.8.0", the evaluateSystemProperties results in "1.8.0_221".

As per the documentation of IVMInstall2.getJavaVersion():

> Returns a string representing the java.version system property of this VM install, or null if unknown.

Both should return the same string value, or null, but not different values.

The JDK in question was downloaded from Oracle. It is used to run Eclipse.

Eclipse Platform

Version: 2019-06 (4.12)
Build id: I20190605-1800
Comment 1 Jay Arthanareeswaran CLA 2019-09-08 23:35:48 EDT
This belongs in debug/launch. Moving to debug.
Comment 2 Eclipse Genie CLA 2021-08-29 06:20:08 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 3 Eclipse Genie CLA 2023-08-21 04:05:25 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.