Skip to content

Commit 651e67d

Browse files
committed
Declared constant for windows os label
1 parent 8f02add commit 651e67d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

vscode/src/constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ export const OPEN_JDK_VERSION_DOWNLOAD_LINKS: { [key: string]: string } = {
2424
"22": "https://download.java.net/java/GA/jdk22.0.1/c7ec1332f7bb44aeba2eb341ae18aca4/8/GPL/openjdk-22.0.1",
2525
"21": "https://download.java.net/java/GA/jdk21.0.2/f2283984656d49d69e91c558476027ac/13/GPL/openjdk-21.0.2"
2626
};
27+
28+
export const NODE_WINDOWS_LABEL = "Windows_NT";

vscode/src/extension.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ import { initializeRunConfiguration, runConfigurationProvider, runConfigurationN
6767
import { InputStep, MultiStepInput } from './utils';
6868
import { PropertiesView } from './propertiesView/propertiesView';
6969
import { openJDKSelectionView } from './jdkDownloader';
70-
70+
import { NODE_WINDOWS_LABEL } from './constants';
7171
const API_VERSION : string = "1.0";
7272
const SERVER_NAME : string = "Oracle Java SE Language Server";
7373
export const COMMAND_PREFIX : string = "jdk";
@@ -955,7 +955,7 @@ function doActivateWithJDK(specifiedJDK: string | null, context: ExtensionContex
955955
if (p == nbProcess && code != 0 && code) {
956956
vscode.window.showWarningMessage(`${SERVER_NAME} exited with ` + code);
957957
}
958-
if (stdErr?.match(/Cannot find java/) || (os.type() === "Windows_NT" && !deactivated) ) {
958+
if (stdErr?.match(/Cannot find java/) || (os.type() === NODE_WINDOWS_LABEL && !deactivated) ) {
959959
vscode.window.showInformationMessage(
960960
"No JDK found!",
961961
"Download JDK and setup automatically"

0 commit comments

Comments
 (0)