Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting a Windows variable to execute a Java program

I am setting this variable

set srcDir = C:\Developpement\Workspaces\Eclipse\MyAuthenticationProvider\src

Then I execute this program

java -DMJF=MyAuthentication.jar -Dfiles=%srcDir% weblogic.management.commo.WebLogicMBeanMaker  

But I have this strange error

The specified input files directory, "%srcDir%", does not exist.

I even tried using

java -DMJF=MyAuthentication.jar -Dfiles=$srcDir weblogic.management.commo.WebLogicMBeanMaker

with the same result

The specified input files directory, "$srcDir", does not exist.

another test:

C:\Developpement\Workspaces\Eclipse\WLAuthenticationProvider>set a=test

C:\Developpement\Workspaces\Eclipse\WLAuthenticationProvider>echo $a
$a

C:\Developpement\Workspaces\Eclipse\WLAuthenticationProvider>
like image 952
Nunyet de Can Calçada Avatar asked Nov 17 '15 10:11

Nunyet de Can Calçada


1 Answers

Currently, you are setting the srcDir with

set srcDir = C:\Developpement\Workspaces\Eclipse\MyAuthenticationProvider\src

Remove the spaces

set srcDir=C:\Developpement\Workspaces\Eclipse\MyAuthenticationProvider\src

I believe your original command will then work.

java -DMJF=MyAuthentication.jar -Dfiles=%srcDir% weblogic.management.commo.WebLogicMBeanMaker
like image 127
Reg Avatar answered Oct 12 '22 01:10

Reg