Reputation: 11201
I am trying to run a java card project. I have installed all the required plugins.
I am running windows in virtual machine in my macbook.
When I try to run the apdutool command from the command prompt:
I see the error:
'C:\Program' is not recognised as an internal command or external command,operable program or batch file.
And then I changed the JAVA_HOME and JC_HOME variables to the following:
JAVA_HOME = C:\Program Files\Java\jdk1.8.0_71\bin
JC_HOME = C:\Users\MrT\Downloads\java_card_kit-2_2_2-windows\java_card_kit-2_2_2\java_card_kit-2_2_2-rr-bin-windows-do\bin
Step 1:
As suggested in the following answer, I included the path in quotes:
now, I set the environment variables as:
JAVA_HOME = "C:\Program Files\Java\jdk1.8.0_71\bin"
JC_HOME = "C:\Users\MrT\Downloads\java_card_kit-2_2_2-windows\java_card_kit-2_2_2\java_card_kit-2_2_2-rr-bin-windows-do\bin"
And when I try to run the apdutool command, I got the error:
Files\Java\jdk1.8.0_71\bin"" was unexpected at this time.
Note: I am running the command from the folder:
C:\Users\MrT\Downloads\java_card_kit-2_2_2-windows\java_card_kit-2_2_2\java_card_kit-2_2_2-rr-bin-windows-do\bin> apdutool
I am not sure wether to set the environment variable as JAVA_HOME or %JAVA_HOME% .
System variable Path is set as:
C:\ProgramData\Oracle\Java\javapath;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\
User variable Path is set as:
C:\Program Files\Java\jdk1.8.0_71\bin
Step 2:
As suggested in the answer:
I set the java_home like this:
set java_home=c:\Program Files\Java
and then I try to run the command:
I got the error:
MrT\Downloads\java_card_kit-2_2_2-windows\java_card_kit-2_2_2\java_card_kit-2_2_2-rr-bin-windows-do\bin"" was unexpected at this time.
also tried this:
set java_home="c:\Program Files\Java"
and I got error:
Files\Java"" was unexpected at this time.
Step 3:
When I use single quotes to set the path in environment variables, I get the error:
The filename, directory name, or volume label syntax is incorrect
Step 4:
I also tried adding % wherever there is a space in the path:
set java_home="c:\Program%Files\Java"
and then it gave me the error:
The system cannot find the path specified.
Can someone assist me in solving the issue ?
Upvotes: 0
Views: 904
Reputation: 11201
I opened the apdutool in word document, and found:
if not "%JAVA_HOME%" == "" goto check_tool
echo Please set the JAVA_HOME environment variable
goto end
and I removed the double quotes around %JAVA_HOME%:
if not %JAVA_HOME% == "" goto check_tool
echo Please set the JAVA_HOME environment variable
goto end
I did the same for JC_HOME
and the error was gone.
Upvotes: 1