Run two versions of ES on machine

Thanks. I confirm that my aim is to have two entirely separate instances of ES running. I want no "sharing of data", indeed no sharing of anything whatsoever. Separate, distinct, apart, unrelated.

The file \config\elasticsearch.yml for 7.10.2 is completely commented-out.

The same file for 8.6.2 has the following uncommented lines:

cluster.name: my-862application
...
node.name: node862-1
...
path.data: D:/temp/es862_data
...
path.logs: D:/temp/es862_logs
...
http.port: 9500

(NB I also tried the above paths with Windows backslashes in the paths: same error).

... are there other "configuration files" which I need to modify for the 8.6.2 setup?

From the error stack trace above, the culprit line would appear to be KeyStoreWrapper.java, line 480: at this point, for some reason, the 8.6.2. jar file decides it wants to use a path with "7.10.2" in it.

So I checked the source code involved here:

// check that replace doesn't change the owner
if (Files.exists(keystoreFile, LinkOption.NOFOLLOW_LINKS)
	&& false == Files.getOwner(keystoreTempFile, LinkOption.NOFOLLOW_LINKS)
		.equals(Files.getOwner(keystoreFile, LinkOption.NOFOLLOW_LINKS))) {
	String message = String.format(
		Locale.ROOT,
		"will not overwrite keystore at [%s], because this incurs changing the file owner",
		keystoreFile
	);
	throw new UserException(ExitCodes.CONFIG, message);
}

... somehow the variable "keystoreFile" seems to have been set "wrongly".

To me this suggests (possibly) that in the course of "registering" ES something has maybe previously happened like maybe a key has been configured in the W10 registry (or something). But I haven't got sufficient knowledge of this level of gory details.

I did a search in the registry on "7.10.2". The most likely key was this:

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Elastic\Elasticsearch\7.10.2: several keys, including "CONFIGDIRECTORY: D:\apps\Elasticsearch\elasticsearch-7.10.2\config"

So I created this key:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Elastic\Elasticsearch\8.6.2: "CONFIGDIRECTORY: D:\apps\Elasticsearch\elasticsearch-8.6.2\config"

... same error. Needs an expert.