Skip to Main Content

Java Card

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

java.lang.UnsatisfiedLinkError: javacard.framework.Util.arrayFill

Richard RedpathOct 10 2024

Where can I find this native library. I am using MacOS and have an Java Card Applet that loads fine using the new Simulator for APDU driving but when I come across usage of this class.

javacard.framework.Util.arrayFill

I get a link error at runtime. Yes, I am very familiar with JNI and have written plenty of native. Maybe someone can point me to the correct JAR though I do have the correct one.

A simple example below is provided and run

[Compile]

javac -cp .:jcardsim-3.0.5-20221215.062536-4.jar TestUtil.java

[Run]

java -cp .:jcardsim-3.0.5-20221215.062536-4.jar TestUtil

here

Exception in thread "main" java.lang.UnsatisfiedLinkError: 'short javacard.framework.Util.arrayFill(byte[], short, short, byte)'

at javacard.framework.Util.arrayFill(Native Method)

at TestUtil.main(TestUtil.java:12)


/****
javac -cp .:jcardsim-3.0.5-20221215.062536-4.jar TestUtil.java 
java -cp .:jcardsim-3.0.5-20221215.062536-4.jar TestUtil
****/
import javacard.framework.Util;

public class TestUtil {
 public static void main(String[] args) throws Exception {
    System.out.println("here");
    byte[] wrkBuff0 = new byte[100];
    short loffset = Util.arrayFill(wrkBuff0, (short)0, (short) 32, (byte) 0xFF);
    System.out.println("here2");
   }
}
Comments
Post Details
Added on Oct 10 2024
2 comments
116 views