Windows environment variables cannot be parsed correctly

JocuperDARY 20 Reputation points
2023-11-14T02:36:31.0466667+00:00

Using a command such as "echo %CLASSPATH%" in the cmd window returns ".;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.;" instead of ".;C:\Program Files\Java\jdk-17.0.5\lib\dt.jar;C:\Program Files\Java\jdk-17.0.5\lib\tools.jar;"

However, if you use the command "echo %JAVA_HOME%", it returns "C:\Program Files\Java\jdk-17"

Some of these environment variables can be parsed, while in some situations they cannot be parsed, which bothers me, hoping to receive a suitable solution.

Version:

Windows11 professional workstation 23H2

22635.2700

Windows Feature Experience Pack 1000.22678.1000.0

Windows for business | Windows Client for IT Pros | User experience | Other
{count} votes

1 answer

Sort by: Most helpful
  1. André van den Berg 246 Reputation points MVP
    2023-11-20T12:07:55.5533333+00:00

    I understand your frustration. It seems that you are facing a common problem with Windows environment variables that are not parsed correctly in some situations. There are a few possible reasons and solutions for this issue:

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.