forcedotcom / sfdx-scanner

MIT License
208 stars 49 forks source link

[BUG] When detecting JAVA version, another number may accidentally get picked up preventing scanner from running. #1453

Closed stephen-carter-at-sf closed 2 months ago

stephen-carter-at-sf commented 2 months ago

See the conversation thread over at https://github.com/forcedotcom/sfdx-scanner/issues/1452

Specifically when a user has their "java --version" on their machine has something like: "Picked up _JAVA_OPTIONS: -Xmx5g" output as the first line... then scanner thinks that 5 is the java version number.

Example:

PS C:\Users\Saurabh Dixit> java -version Picked up _JAVA_OPTIONS: -Xmx5g java version "22.0.1" 2024-04-16 Java(TM) SE Runtime Environment (build 22.0.1+8-16) Java HotSpot(TM) 64-Bit Server VM (build 22.0.1+8-16, mixed mode, sharing)

git2gus[bot] commented 2 months ago

This issue has been linked to a new work item: W-15655278

AdnanSami-techie commented 1 month ago

When I try to run the scanner, I receive the error: 'Java version 4 is not supported. Install Java 1.8 or later.' I have already installed Java 18. Could you please help me on the same @stephen-carter-at-sf

I cannot delete Java tool options as workaround