It's our great honour to announce the Industry’s First VHBR CCID reader - VHBR Dual interface smart card reader vR504. It is able to support the world’s fastest ePassports.

To celebrate the new product release, there is Special Discount for New Registered Members in our store.
- Get $20.00 OFF instantly for smart card reader vR504, R502 and bR301

Come to get the readers now!

how to set project configuration

JCIDE related questions and answers.

Moderators: product, kuafu

a803904
Posts: 1
Joined: Fri Jun 29, 2018 10:57 am
Points: 34
Contact:

how to set project configuration

Postby a803904 » Mon Jul 02, 2018 11:32 pm

JCIDE 2.0.6.2
where to set compile file encoding?
where to set jc.home property?

: Converter [v3.0.4]
03, 2018 11:30:59
: Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.


error: Java property "jc.home" is not set.
com.sun.javacard.converter.ConverterException
Cap file generation failed.

kuafu
Posts: 79
Joined: Thu Jun 25, 2015 2:09 am
Points: 1025
Contact:

Re: how to set project configuration

Postby kuafu » Thu Jul 12, 2018 1:17 am

Hi all,
I found some bug on converter of the JCDK v3.0.4.
1. In some case (some class in package implements the Shareable interface, exp) , the ant task of converter throws error like this:
[convert] error: Java property "jc.home" is not set.
[convert] com.sun.javacard.converter.ConverterException
[convert]
[convert] Cap file generation failed.
But, when convert same package with the JCDK/bin/converter.bat directly, it's fine.
By watched the convert.bat file, and decompiled the jctask.jar, I got the bug.
According to convert.bat file: "%JAVA_HOME%\bin\java" -Djc.home=%JC_CLASSIC_HOME% -classpath %JC_CLASSPATH% com.sun.javacard.converter.Main %*, we found there is a arg named jc.home is needed in com.sun.javacard.converter.Main. when this Class is forked in the ant task, this arg is missing.
Because converterTask is the subclass of JavaTask and extended the JavaTask's attributes, so can fixed the bug by add this attributes to task XML: <jvmarg value="-Djc.home=${env.JC_CLASSIC_HOME}"/>, but it's should still be treated as a bug.
2.When a Shareable interface is implements by other package, in the out-dir a same package and a same java and class file of the Interface is created . and this java file and class file may not same as original one, the fileds of Interface is deleted, only keep the methods. If we use the same SrcDir and DstDir, the package of the Shareable Interface 's class file will be replaced, and will failed in convert.
here is the my example xml file of ant in v3.0.4
<convert JCA="true" CAP="true" EXP="true" ClassDir="${JCAPI_BIN}" Outputdirectory="${JCAPI_CAP}" exportmap="true" debug="true" packagename="org.globalplatform" packageaid="0xA0:0x00:0x00:0x01:0x51:0x00" majorminorversion="1.0">
<jvmarg value="-Djc.home=${JC_HOME}"/>
<exportpath path="${JCAPI_EXP}" ></exportpath>
<classpath refid="CONVERTER_PATH" />
</convert>
it's very complex then v 2.2.2
<convert JCA="true" CAP="true" EXP="true" dir="${JCAPI_BIN}" exportmap="true" debug="true" packagename="org.globalplatform" packageaid="0xA0:0x00:0x00:0x01:0x51:0x00" majorminorversion="1.0">
<exportpath path="${JCAPI_EXP}" ></exportpath>
<classpath refid="CONVER_PATH" />

kuafu
Posts: 79
Joined: Thu Jun 25, 2015 2:09 am
Points: 1025
Contact:

Re: how to set project configuration

Postby kuafu » Thu Jul 12, 2018 1:18 am

1.jpg
2.jpg
set compile file encoding
You do not have the required permissions to view the files attached to this post. Please login first.

kuafu
Posts: 79
Joined: Thu Jun 25, 2015 2:09 am
Points: 1025
Contact:

Re: how to set project configuration

Postby kuafu » Thu Jul 12, 2018 4:37 am

a803904 wrote:JCIDE 2.0.6.2
where to set compile file encoding?
where to set jc.home property?

: Converter [v3.0.4]
03, 2018 11:30:59
: Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.


error: Java property "jc.home" is not set.
com.sun.javacard.converter.ConverterException
Cap file generation failed.


JCIDE need to add "-Djc.home=%JC_CLASSIC_HOME%" when compiler to fix the problem.


Return to “Questions & Answers”

Who is online

Users browsing this forum: No registered users and 1 guest

JavaCard OS : Disclaimer