Forum Stats

  • 3,826,581 Users
  • 2,260,667 Discussions
  • 7,897,008 Comments

Discussions

Converter command + multiple applets

Bluefairy
Bluefairy Member Posts: 49
edited Jul 3, 2011 2:04PM in Java Card
Hi there,

I'm trying to learn how to have two applets in one package. So, I developed a java code which has two classes extended from applet class and I compiled this two classes. Now, I want to convert this two .class files into one .cap file. I always used this command in windows command prompt to convert one applet .class file into .cap file:

converter -exportpath "F:\javacard-DevelopementKit\java_card_kit-2_2_2-windows\java_card_kit-2_2_2\api_export_files" -classdir ".\classes" -applet 0xa0:0x0:0x0:0x0:0xd7:0x85:0x1:0x3a:0x3:0x28 com.sun.javacard.samples.HelloWorld.HelloWorld com.sun.javacard.samples.HelloWorld 0xa0:0x0:0x0:0x0:0xd7:0x85:0x1:0x3a:0x3 1.0

but now when I use such a command to convert two classes into one cap file, I receive errors which states that this command is wrong. I tested many combinations like this:

converter -exportpath "F:\javacard-DevelopementKit\java_card_kit-2_2_2-windows\java_card_kit-2_2_2\api_export_files" -classdir ".\classes" "-applet 0xa0:0x0:0x0:0x0:0xd7:0x85:0x1:0x3a:0x3:0x28 com.sun.javacard.samples.HelloWorld.HelloWorld -applet 0xa0:0x0:0x0:0x0:0xd7:0x85:0x1:0x3a:0x3:0x29 com.sun.javacard.samples.HelloWorld.HH"
com.sun.javacard.samples.HelloWorld 0xa0:0x0:0x0:0x0:0xd7:0x85:0x1:0x3a:0x3 1.0

where the name of the applet classes are: HelloWorld, HH
and the package name of both of them is HelloWorld.

I took a look at JDK user guide document, but there wasn't a brief explanation about converting multiple applets.

Could somebody please tell me how should I use the converter command to do this?

-Thanks a lot
Tagged:

Answers

  • safarmer
    safarmer Member Posts: 2,829
    Hi,

    I am not sure about the command line tools but the Ant task can handle this for you.
    <target name="convert" depends="compile" description="Convert class files to cap files">
    	<convert packagename="com.sun.javacard.samples.HelloWorld" packageaid="0xa0:0x0:0x0:0x0:0xd7:0x85:0x1:0x3a:0x3" majorminorversion="1.0" classdir="${target.classes}" outputdirectory="${target.classes}" jca="true" exp="true" cap="true" debug="true" verbose="${verbose}" noverify="${noverify}">
    		<appletnameaid aid="0xa0:0x0:0x0:0x0:0xd7:0x85:0x1:0x3a:0x3:0x28" appletname="com.sun.javacard.samples.HelloWorld.HelloWorld" />
    		<appletnameaid aid="0xa0:0x0:0x0:0x0:0xd7:0x85:0x1:0x3a:0x3:0x29" appletname="com.sun.javacard.samples.HelloWorld.HH" />
    		<exportpath refid="export" />
    		<classpath refid="classpath" />
    	</convert>
    </target>
    There are a few bits of my build script referenced there but you get the picture : )

    Cheers,
    Shane
This discussion has been closed.