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!

Linux and JCOP_Tool 3.1.1.b Installation Guide

843851Mar 2 2009 — edited Jul 14 2009
Guide for Debian 4.0 and JCOP_Tool 3.1.1.b

Step 1. Install pcscd and reader driver, Here we use Omnikey CardMan 5321.
su
apt-get update
apt-get upgrade
aptitude install pcscd pcsc-tool libpcsclite libpcsclite-dev
su - sonnyyu
wget http://www.hidglobal.com/drivers/omnikey/ifdokrfid_lnx-2.6.0.tar.gz
tar -zxvf ifdokrfid_lnx-2.6.0.tar.gz
cd ifdokrfid_lnx-2.6.0/
su
./install
ln -s /usr/local/pcsc/drivers/ifdokrfid_lnx-2.6.0.bundle /usr/lib/pcsc/drivers
/etc/init.d/pcscd stop
pcscd --apdu --foreground
# If you get Card ATR, means reader, pcsc install fine.
#Card ATR: 3B 89 80 01 4A 43 4F 50 33 31 56 32 32 4A
Step 2. Install Java 1.4.2_18 and eclipse-SDK-3.2.1 and JCOP Tool 3.1.1.b
su
nano /etc/apt/sources.list
# add "deb http://ftp.us.debian.org/debian/ etch main contrib non-free"  into sources.list
apt-get update
apt-get install java-package
wget http://vdt.cs.wisc.edu/software/jdk/1.4.2_18/j2sdk-1_4_2_18-linux-i586.bin
apt-get install build-essential
su - sonnyyu
fakeroot make-jpkg j2sdk-1_4_2_18-linux-i586.bin
su
dpkg -i sun-j2sdk1.4_1.4.2+18_i386.deb
java -version
# java version "1.4.2_18" means 1.4.2_18 install correctly
su - sonnyyu
wget http://archive.eclipse.org/eclipse/downloads/drops/R-3.2.1-200609210945/eclipse-SDK-3.2.1-linux-gtk.tar.gz
tar -zxvf eclipse-SDK-3.2.1-linux-gtk.tar.gz
# Now  Run eclipse at GTK and install JCOP Tool 3.1.1.b, procedure smae as Windows.
Step 3. Make sure JPCSC run OK at Debian.
Creat Java project.
import com.linuxnet.jpcsc.*;

public class reader_test_cls {
	
	 public static void main(String[] arg) {
		 try {
	         Context context = new Context();
	         context.EstablishContext(PCSC.SCOPE_GLOBAL, null, null);
	         String[] readers = context.ListReaders();
	         if (readers.length <= 0) {
	            System.err.println("No readers found...");
	            return;
	         }
	         String reader = readers[0];
	         System.out.println("Using reader " + reader);
	         Card card = context.Connect(reader);
	         //card.Disconnect();
	         context.ReleaseContext();
	      } catch (Exception e) {
	         System.out.println("Error: " + e.getMessage());
	      }
		 
		 
		 
	   }

}
By use External Jar "eclipse/plugins/com.ibm.bluez.jcop.eclipse_3.1.1.b/lib/jpcsc.jar"

If error occur Exception in thread "main" java.lang.UnsatisfiedLinkError: no jpcsc in java.library.path
ln -s /home/sonnyyu/eclipse/plugins/com.ibm.bluez.jcop.eclipse_3.1.1.b/os/linux/x86/libjpcsc.so  /usr/lib/j2sdk1.4-sun/jre/lib/i386/client/libjpcsc.so
If error occur Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/sonnyyu/eclipse/plugins/com.ibm.bluez.jcop.eclipse_3.1.1.b/os/linux/x86/libjpcsc.so: libpcsclite.so.0: cannot open shared object file: No such file or directory
ln -s /usr/lib/libpcsclite.so.1.0.0  /usr/lib/j2sdk1.4-sun/jre/lib/i386/libpcsclite.so.0
Once Java project detect reader, go next step.

Step 4. Activate JCOP tool with IBM Sample Enginere Card.

The whole processing should not take more than few minutes if you have high speed connection to Internet, >=1Gb is good.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 11 2009
Added on Mar 2 2009
10 comments
1,296 views