Excited to tell you that our welfare activity has been upgraded - Paying only $5.00 + Freight to get JCOP J3H145 card and A40CR card.
Please check this post for more details.

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 :38
Contact:

how to set project configuration

Post by 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: 91
Joined: Thu Jun 25, 2015 2:09 am
Points :1137
Contact:

Re: how to set project configuration

Post by 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: 91
Joined: Thu Jun 25, 2015 2:09 am
Points :1137
Contact:

Re: how to set project configuration

Post by kuafu » Thu Jul 12, 2018 1:18 am

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

kuafu
Posts: 91
Joined: Thu Jun 25, 2015 2:09 am
Points :1137
Contact:

Re: how to set project configuration

Post by 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.

javacardstudy
Posts: 4
Joined: Thu Jul 26, 2018 5:55 am
Points :50
Contact:

Re: how to set project configuration

Post by javacardstudy » Thu Aug 09, 2018 4:52 am

kuafu wrote:
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.
Hi.please Where to add this "-Djc.home=%JC_CLASSIC_HOME%" ,thanks.

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 0 guests

JavaCard OS : Disclaimer