TCP
TCP

Reputation: 33

Setting environment variables on cmd. Help needed

Trying to set on variable up in my Command Prompt but not sure what syntax to use.

I've tried:

SET %JAVA_HOME%\bin\java -jar helloworld.jar=HELLO_WORLD
SET HELLO_WORLD

and also:

SET "%JAVA_HOME%\bin\java -jar helloworld.jar=HELLO_WORLD"
SET HELLO_WORLD

None of them seem to work. Anyone have any ideas how to get a variable for the above?

Thanks.

Upvotes: 0

Views: 48

Answers (1)

oratom
oratom

Reputation: 291

you have to place the variable-name in front auf the equal-sign and the commandline:

C:\Windows\system32>set HELLO_WORLD=%JAVA_HOME%\bin\java -jar helloworld.jar

C:\Windows\system32>set HELLO_WORLD
HELLO_WORLD=%JAVA_HOME%\bin\java -jar helloworld.jar

Upvotes: 1

Related Questions