Skip to Main Content

Java Card

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Generating the .CAP, .JCA and .EXP files.

843851May 25 2010 — edited May 26 2010

Hello;



I have downloaded the java_card_kit-2_1_2 to ‘C:\java_card_kit-2_2_1", and I tried to compile HelloWorld application that shipped with its distribution. I was successfully able to compile the file HelloWorld.java, but I am having lots of problems in generating the .CAP, .JCA and .EXP files.



I tried to follow the instructions in jcdk2.2.1 user guide, but of no use.



This is what I am basically doing:



_Step1) Setting my Environment Variables as follows:_



*set JC_HOME=C:\java_card_kit-2_2_1*


*set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_16*


*set PATH=.;%JC_HOME%\bin;%JAVA_HOME%\bin;%PATH%*



_Step2) Compile the java file_



The package of HelloWorld.java is : src.com.sun.javacard.samples.HelloWorld, so to compile I use the following command line:



*javac -g -target 1.1 -source 1.3 -classpath .\classes;..\lib\api.jar;..\lib\installer.jar src\com\sun\javacard\samples\HelloWorld\*.java*



_Step3) Converting_



I have the class file generated in the package folder: src.com.sun.javacard.samples.HelloWorld, I generated an .opt file as follows:



+-out EXP JCA CAP+


+-exportpath .+


+-debug+


+-applet 0xa0:0x0:0x0:0x0:0x62:0x3:0x1:0xc:0x1:0x1 src.com.sun.javacard.samples.HelloWorld.HelloWorld+


+src.com.sun.javacard.samples.HelloWorld 0xa0:0x0:0x0:0x0:0x62:0x3:0x1:0xc:0x1 1.0+



Finally, the command line for conversion is:



*set _CLASSES=%JC_HOME%\lib\apduio.jar;%JC_HOME%\lib\apdutool.jar;%JC_HOME%\lib\jcwde.jar;%JC_HOME%\lib\converter.jar;%JC_HOME%\lib\scriptgen.jar;%JC_HOME%\lib\offcardverifier.jar;%JC_HOME%\lib\api.jar;%JC_HOME%\lib\installer.jar;%JC_HOME%\lib\capdump.jar;%JC_HOME%\samples\classes;%CLASSPATH%;*



*"%JAVA_HOME%\bin\java" -classpath %_CLASSES% com.sun.javacard.converter.Converter -config src\com\sun\javacard\samples\HelloWorld\HelloWorld.opt*



After successfully executing all these lines, I get the following error:



Java Card 2.2.1 Class File Converter, Version 1.3


Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.


*+error: class HelloWorld does not belong to package src.com.sun.javacard.samples.HelloWorld.+*


conversion completed with 1 errors and 0 warnings.



PLEASE HELP! I also tried adding -classdir to the opt file, but still did not work.

The whole point behind this exercise is to import a javacard framework of version 1.0


Really appreciate anyone's help! Thanks in advance.


Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 23 2010
Added on May 25 2010
3 comments
718 views