Programming for Java Card 3 platform in Eclipse - eclipse

I've wrote programs for Java Card 2.2.2 in Eclipse using EclipseJCDE plugin and Java Card 2.2.2 Development Kit.
Now I want to write programs for my smart card that is a Java Card 3.0.1 Classic Edition, but I don't have any idea how I can do it!
Can I wrote my programs in Eclipse now or I need a new plugin?
As far as I know I must download a new development kit for this new platform. So I searched Oracle. Some where it is mentioned that :
The Java Card 3 platform consists of versions 3.0, 3.0.1 and 3.0.4 of
the specifications and versions 3.0.1, 3.0.2, 3.0.3 and 3.0.4 of the
development kit.
So I downloaded the Java Card 3.0.1 specification and Java Card 3.0.3 development kit. But it is not really a development kit! It is a .jar file only!
What shall I do with this .jar file? Should I import it as library in my project along with the libraries of JC 2.2.2?
Or I must copy it in the bin directory of the previous development kit?
I'm really confused about it! Should I add another plugin for Eclipse? Or I must change mu IDE?
Why JC 3.0.3 Development kit is not similar with JC 2.2.2 Development kit?
BTW, I add it to the JAR file libraries in my project, but it contains some weird classes that I didn't see them in JC 3.0.1 API Specifications! And it doesn't contain any framework or APDU or ... class!
What shall I do to be able write programs for Java Card 3.0.1? and how can I convert them to .cap file? (As far as I know I can't use the converter anymore, Is it right?)

To develop for Java Card target 3.0.1 in Eclipse (on any platform):
Get Java Card 3.0.3 development kit (JCDK 3.0.3 implements specification 3.0.1). You can get it here. Alternatively you can download it from Oracle web page, but then you will need Windows machine to install .jar and get its contents.
Download Java Card 3.0.1 specification (java_card_kit-3_0_1-doc-spec-rr-15_may_2009.zip). Extract its contents.
In Eclipse right-click on your project "Build Path --> Add External Archives..." and add lib/api_classic.jar from the 3.0.3 development kit directory. This will enable code completion and fix potential import errors.
In Eclipse right-click on api_classic.jar --> "Properties --> Javadoc location path:" and specify javacard_specifications-3_0_1-RR/classic/api_classic/ from the 3.0.1 specification directory. This will enable javadoc for Java Card API calls.
To convert your project's .class files to .cap files use ant-javacard. Run ant from the directory where build.xml and ant-javacard.jar is located. Here is build.xml example:
<?xml version="1.0" encoding="UTF-8"?>
<project name="Hello World" default="Hello" basedir=".">
<target name="jcpro">
<taskdef name="javacard" classname="pro.javacard.ant.JavaCard" classpath="ant-javacard.jar"/>
</target>
<target name="Hello" depends="jcpro">
<javacard>
<cap jckit="jc303_kit/" aid="01020304050607080900" output="testjcard.cap" sources="workspace/testjcard/src/testjcard/">
<applet class="testjcard.JTest" aid="0102030405060708090005"/>
</cap>
</javacard>
</target>
</project>
The build.xml can also be added under your project in Eclipse.
Upload the produced .cap file into the smart card using gp.jar from GlobalPlatformPro:
java -jar GlobalPlatformPro/gp.jar -delete 0102030405060708090005
java -jar GlobalPlatformPro/gp.jar -delete 01020304050607080900
java -jar GlobalPlatformPro/gp.jar -install testjcard.cap

The .jar is actually just an installer. You'll have to run it to get the real runtime using java -jar <file.jar>. Then you should get the SDK.

I install java_card_kit-classic-3_0_5-u4-win32-bin-do-b_109-03_jun_2020.msi in my eclipse, and i can create java card3 project, but it said An error occurred while creating the Java Card Project. javax/xm/bind/JAXBEception

Related

log4j-core-2.8.2 jar in eclipse4.16 getting created automatically

I have downloaded Eclispe 4.16 version zip file and using this to create UFT developer Maven project with TestNG framework. I have observed that log4j-core-2.8.2 is getting created in C:\eclipse\configuration\org.eclipse.osgi\455\0.cp\lib folder. This log4J version is vulnerable as per my understanding.
If i delete this 455 folder then This folder(455)getting created automatically after opening eclipse
Please could you suggest how to remove this Log4J version or update to Log4J2.17 version ?
My organization asked me remove this Log4J 2.8.2 from drive
NOTE: I am working on UFT Developer project which supports only eclipse 4.16(2020-06) or earlier version
Thanks
Devkant

Where to find core eclipse plugins for the Hello World sample plugin project?

I have eclipse oxygen installed and I'm trying to create the sample HelloWorld plugin project.
The plugin project has dependencies on core plugins from the org.eclipse.core/ui/jface etc libraries and I can't find them anywhere on my local machine so that I can add them to my target platform and have them resolved.
Where are these jars supposed to be?

Java Card 2.2.1 Application with Eclipse

I want to develop an applet for Java Card 2.2.1 using Eclipse and SDK Java Card kit.
I am unable to set up Java Card 2.2.1 in Eclipse; It's okay when I use Java Card 2.2.2.
How can I set up Java card 2.2.1 in Eclipse?
Eclipse Version 4.4.2
JRE 1.8.0
I had the same problem, It's a little tricky to solve it. Keep Eclipse open, minimize it and then explore the JCDK direcory in your computer and replace JCDK2.2.2 contents with JCDK2.2.1 contents. Now maximize Eclipse again convert your applets.
Similar problems, are generally caused by version are not compatible. You can replace the JCDK version as the Applet version, can be solved.
you can try to use JCIDE to develop your Java Card Applet, it is a free IDE for both Java Card 2.2.1 and Java Card 2.2.2. http://www.javacos.com/sdkinfo.php

How to install jcdk 2.2.1 in Eclipse [Version: Kepler Service Release 2]?

I want to install jcdk 2.2.1 in Eclipse, but it only accept jcdk 2.2.2! as you see in the below I have converter.jar is not compatible error.
How I can solve this problem? thank you.
Update: I try to install JCDK 2.2.1 with jcde 0.1 or 0.2 installed on Eclipse!but nothing change. and in both, Eclipse require directory of JCDK 2.2.2
I set eclipse with java kit 2.2.2 then I close eclipse window and replace the contents of java kit 2.2.2 with contents if java kit 2.2.1 and the problem solved.
java card kit 2.2.2 file is good, you have to :
unzip the file you downloaded.
open the folder named java card kit 2.2.2
unzip the folder that finishes with "windows-do" or "linux-do" (depends of what you downloaded/needed).
Finally, come back to eclipse, and browse to that last folder you unzipped.

Using Eclipse 3.7 for developing Plugin based on Eclipse RCP 3.5

is it possible to use Eclipse 3.7 IDE for developing for the 3.5 platform? Or must I use Eclipse 3.5 IDE?
When I try to switch from Eclipse 3.5 IDE to 3.7 I get errors on projects, which were ok before:
Archive for required library: 'C:/.../.metadata/.plugins/org.eclipse.pde.core/.external_libraries/xyz/os/win32/x86' in project 'projectname' cannot be read or is not a valid ZIP file projectname
What do I have to do to exchange the 3.5 IDE with a current one, but still develop for the 3.5 platform?
I hope my explanation did make sense and was understandable :)
Additional Info:
- I never used the RCP before, now I must use it
- It's no option to upgrade the target platform (3.5)
- I searched the net and stackoverflow, but found no answers for using 3.7 and develop for target platform 3.5 (maybe nobody else has these problems or I used the wrong queries)
Cheers
Kai
Use the menu
Window > Preferences:
Plug-in development > target platform
Here you can add your eclipse 3.5 as a target platform, and then set it active.
But I don't think this will solve the errors you mentioned. I think those errors are because you are using the old workspace folder, and there is something not compatible with eclipse3.7. So maybe you can try to switch to a new workspace, and import your projects there.
I just resolved my problem :-)
In my case, there was a plugin jar, that contained the java sources:
jar
com
META-INF
src
plugin.xml
It seems like eclipse is putting jars inside of plugin jars in the following directory:
[WORKSPACE]\.metadata\.plugins\org.eclipse.pde.core\.external_libraries\...
For my plugin, it tried to put the src folder in this directory - which somehow failed.
After deleting the src folder inside the jar, the errors were gone.
RCP == bag of pain :-)