Our Online Store have the new products: RFID antenna board. Currently it can work with JC10M24R and JCOP4 card chips.
Compared with normal cards, the antenna board module has a smaller size and fixed holes, which is easy to integrate in the IOT(Internet Of Things) project.

javacard.framework cannot be found

JavaCard Applet Development Related Questions and Answers.
Maelstorm
Posts: 1
Joined: Tue May 18, 2021 6:29 pm
Points :14
Contact:

javacard.framework cannot be found

Post by Maelstorm » Tue May 18, 2021 8:53 pm

Hello,

I am trying to compile the Hello World program found here: https://javacardos.com/javacardforum/vi ... f=31&t=114. When I try to build it, I'm getting multiple errors all stemming from javacard.framework cannot be found. This is a fresh install of JCKit v7.1.0.0. This is installed on a Windows 10 machine.

Here's the errors that I'm getting:

Code: Select all

Start task:"C:/Program Files/JavaCardOS/JavaCardKit/SDK/Tools/JDK/bin/java.exe" -jar "C:/Program Files/JavaCardOS/JavaCardKit/SDK/Tools/JCIDE/builder/ECJ/ecj.jar" -g -deprecation -target 1.7 -source 1.7 -J-Duser.language=en -d "C:/Development/SmartCard/appletDemo/bin/Debug" -encoding windows-1252 C:/DEVELO~1/SMARTC~1/APPLET~1/src/APPLET~1/appletDemo.java 
----------
1. ERROR in C:\Development\SmartCard\appletDemo\src\appletDemo\appletDemo.java (at line 5)
	import javacard.framework.*;
	       ^^^^^^^^
The import javacard cannot be resolved
----------
2. ERROR in C:\Development\SmartCard\appletDemo\src\appletDemo\appletDemo.java (at line 13)
	public class appletDemo extends Applet
	                                ^^^^^^
Applet cannot be resolved to a type
----------
3. ERROR in C:\Development\SmartCard\appletDemo\src\appletDemo\appletDemo.java (at line 24)
	new appletDemo().register(bArray, (short) (bOffset + 1), bArray[bOffset]);
	                 ^^^^^^^^
The method register(byte[], short, byte) is undefined for the type appletDemo
----------
4. ERROR in C:\Development\SmartCard\appletDemo\src\appletDemo\appletDemo.java (at line 27)
	public void process(APDU apdu)
	                    ^^^^
APDU cannot be resolved to a type
----------
5. ERROR in C:\Development\SmartCard\appletDemo\src\appletDemo\appletDemo.java (at line 30)
	if (selectingApplet())
	    ^^^^^^^^^^^^^^^
The method selectingApplet() is undefined for the type appletDemo
----------
6. ERROR in C:\Development\SmartCard\appletDemo\src\appletDemo\appletDemo.java (at line 40)
	if(buf[ISO7816.OFFSET_CLA] != CLA_DEMO_TEST)
	       ^^^^^^^
ISO7816 cannot be resolved to a variable
----------
7. ERROR in C:\Development\SmartCard\appletDemo\src\appletDemo\appletDemo.java (at line 42)
	ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);
	^^^^^^^^^^^^
ISOException cannot be resolved
----------
8. ERROR in C:\Development\SmartCard\appletDemo\src\appletDemo\appletDemo.java (at line 42)
	ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);
	                     ^^^^^^^
ISO7816 cannot be resolved to a variable
----------
9. ERROR in C:\Development\SmartCard\appletDemo\src\appletDemo\appletDemo.java (at line 45)
	switch (buf[ISO7816.OFFSET_INS])
	            ^^^^^^^
ISO7816 cannot be resolved to a variable
----------
10. ERROR in C:\Development\SmartCard\appletDemo\src\appletDemo\appletDemo.java (at line 54)
	Util.setShort(buf, (short)0, (short)0x5555);
	^^^^
Util cannot be resolved
----------
11. ERROR in C:\Development\SmartCard\appletDemo\src\appletDemo\appletDemo.java (at line 60)
	ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
	^^^^^^^^^^^^
ISOException cannot be resolved
----------
12. ERROR in C:\Development\SmartCard\appletDemo\src\appletDemo\appletDemo.java (at line 60)
	ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
	                     ^^^^^^^
ISO7816 cannot be resolved to a variable
----------
13. ERROR in C:\Development\SmartCard\appletDemo\src\appletDemo\appletDemo.java (at line 65)
	private void SendData(APDU apdu) 
	                      ^^^^
APDU cannot be resolved to a type
----------
14. ERROR in C:\Development\SmartCard\appletDemo\src\appletDemo\appletDemo.java (at line 74)
	Util.arrayCopyNonAtomic(sendStr, (short)0, buffer, (short)0, (short)len);
	^^^^
Util cannot be resolved
----------
14 problems (14 errors)
Task done
As a side note, the IDE won't run as a regular user. I have to be on an admin account to be able to use it. Is there any way around this?

whitexiao
Posts: 20
Joined: Wed Sep 09, 2015 8:45 am
Points :128
Contact:

Re: javacard.framework cannot be found

Post by whitexiao » Fri May 21, 2021 4:03 am

Maybe you can try to set the 'C:/Program Files/JavaCardOS/JavaCardKit/SDK/Tools/JDK' path to your Environment Variable of JAVA_HOME

jverne
Posts: 1
Joined: Tue May 25, 2021 9:01 am
Points :20
Contact:

Re: javacard.framework cannot be found

Post by jverne » Tue May 25, 2021 9:44 am

If you open the IDE and hover the mouse over one of the redlined imports you may get a pop-up that shows how to configure the project with the right SDKs and jars. This project config does not seem exposed to any menu item (why not?)

For the demo PKIApplet I had to select a version of the "JavaCard Kit" and "gp" (for the GPS import). Both are located in C:/JavaCarDKit/SDK/Tools/ChipPack/JAVACOS/lib

Once you do this, you'll see that the .classpath file has been updated, so I presume you could modify that directly.

e.g.:

Code: Select all

<classpath>
    <classpathentry kind="output" path=".jcide/jdt/bin/Debug" />
    <classpathentry kind="lib" path="C:/JavaCardKit/SDK/Tools/ChipPack/JAVACOS/lib/java_card_kit/3_0_4/lib/api_classic.jar" sourcepath="C:/JavaCardKit/SDK/Tools/ChipPack/JAVACOS/lib/java_card_kit/3_0_4/api_attach_source.jar" />
    <classpathentry kind="src" path="src" />
    <classpathentry kind="lib" path="C:/JavaCardKit/SDK/Tools/ChipPack/JAVACOS/lib/gp/gp211/lib/gp211.jar" sourcepath="C:/JavaCardKit/SDK/Tools/ChipPack/JAVACOS/lib/gp/gp211/lib/gp211.jar" />
</classpath>
This builds, but I don't know what this will do at runtime.

You can also get to these settings by right-clicking on the project (i.e., not the entire solution) and selecting Properties. From there you can manipulate library and API dependencies, compilation settings, etc.

BTW, I don't think messing with JAVA_HOME will help here. These dependencies are not found via JAVA_HOME, but the Eclipse classpath loader. This is, or should be, a pure Eclipse configuration issue.

watson
Posts: 1
Joined: Mon Jun 28, 2021 3:36 am
Points :8
Contact:

Re: javacard.framework cannot be found

Post by watson » Mon Jun 28, 2021 3:38 am

Same problem. I tried the solution you suggested but it still hasn't work.

mbsysde99
Posts: 40
Joined: Tue Oct 24, 2017 1:10 pm
Points :484
Contact:

Re: javacard.framework cannot be found

Post by mbsysde99 » Tue Jan 04, 2022 10:34 am

Deleted this comment
Last edited by mbsysde99 on Tue Jan 11, 2022 6:40 pm, edited 1 time in total.

mbsysde99
Posts: 40
Joined: Tue Oct 24, 2017 1:10 pm
Points :484
Contact:

Re: javacard.framework cannot be found

Post by mbsysde99 » Tue Jan 04, 2022 10:39 am

1. From JCIDE >
User Package View >
Right Click on appletDemo >
Properties >
Library Options >
Add JC Kit >
Select java_card_kit-2_2_2 >
OK >
OK

2. Then From JCIDE >
Build >
Rebuild All Projects (Or press F7)

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: Bing [Bot] and 56 guests

JavaCard OS : Disclaimer