Install cap file in card with error 6985 - applet

I want to install my applet on card.
I generated cap file in eclipse with java card tool menu and generate script option.
I used gpshell.exe for install my applet.
my card supports java card platform 2.2.1 but eclipse generates cap file with java card platform 2.2.2 thus I did all steps in link enter link description here for recompile my applet with 2.2.1
but I'm not sure I did successful.Is another solotion to recompile my applet with jdk 2.2.1 exactly with eclipse?
I run gpshell scripts for install my applet:
step Install for load is executed successful but
load -file test.cap I get error 6985.
I will send my result

I can not use eclipse to generat cap file with version 2.2.1 but I can do it with JCISDE (java Cos)

Related

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

Programming for Java Card 3 platform in 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

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.

Eclipse Kepler: how to export RCP product as an executable jar

I just started using Eclipse Kepler. From the Overview tab I'm able to select 'Eclipse Product export wizard' which generates an executable (.exe) that can be executed from the command line.
How can I export the product as an executable .jar that can be executed from the command line?
Eclipse RCPs are always executable .exe files (or the equivalent on other platforms), there is no option to create a Jar file.
Eclipse code contains platform specific components so you have to do a different build for each platform.
If you want to generate code to run on Linux, Mac OS X or the other supported platforms you need to check the Export for multiple platforms option on the product export page and select the platforms on the next page of the wizard.
You will need to install the RCP Delta Pack to build for multiple platforms.
Update: The Export wizard is now deprecated. tycho and maven is now the recommened way to build RCPs.
See Eclipse Products and Deployment for more details.
While there is no option to export your product as an executable .jar, you can start your application without using the executable (.exe). All the executable does is show the splash screen, load a JVM and start the Equinox launcher which is an executable .jar.
You can start the Equinox launcher from the command line yourself with the command java -jar plugin\org.eclipse.equinox.launcher_<version>.jar which will start the application (without the splash screen of course).
The Eclipse wiki has launcher scripts that make it easier to deal with the version part of the plugin name.
This will however not make the application launch on other platforms as it still contains platform specific plugins. See greg-449's answer on how to export for multiple platforms if that's what you want to do.

Load an applet with specified older JRE version instead of latest installed

I wish to load my applet with JRE version 1.6.0_14. I have installed updates 14, 17, 24 and 35. I am using <object> tag with classid to load version with update 14.
in this case, the applet get loaded with update 35 and then again with update 14. on the java console on update 35 no error noticed and on Java console of update 1.6.0_14 we see the following error.
java.lang.ClassNotFoundException: sun/net/www/protocol/http/NTLMAuthenticationCallback
How to avoid higher version JRE to be used? And how to avoid the class not found error?
It is a serious security risk to run with a lower version of the JRE. Not when you run your own applet, cause you trust your own code. But others ought to refuse running it. You, yourself, should be wary when browsing the net with a browser that does not have the latest version of the JRE installed.
The JRE installer installs the Java Plugin into your browser and one single version of the Plug-in will always be started, independent of the Java version you request. The Plugin will then run the applet in the JRE that is specified in the classid of your object tag. The versions available to the Plug-in are configurable in the Java Control Panel.
This leaves the question of why your application won't run with a recent version of java 1.6. The Plugin got a big overhaul in 1.6.0_something into what's called the Next Generation Plug-in. Maybe that is what is giving you trouble. You can indicate that you wish to use the old Plug-in on your machine in the Java Control Panel on the advanced tab. ("Enable the Next Generation Java Plug-in (requires a Browser restart"). I'd think it's interesting to know if disabling the Next Generation Plug-in solves your issue.