From YobiWiki
Jump to: navigation, search


Standards & Documents


Generally speaking JCOP-specific detailed information can only be obtained at NXP.
This page does not contain any sensitive information, only tips & tricks for people having already obtained such info & tools in adequate way.
Current versions:

  • JCOP v2.4.1 R3
    • JavaCard 2.2.2
    • GlobalPlatform 2.1.1
  • JCOP v2.4.2 R2
    • JavaCard 3.0.1 Classic
    • GlobalPlatform 2.2

JCOP Tools

Tools can be obtained by contacting
Current version: NXP JCOP Plugins Generic v3.3.6 & Target v1.3.6
Current requirements are WinXP SP3, Win7 32bit or Win7 64bit, and Eclipse 3.6 or 3.7
So as you can see this is a Windows-only release, goal of this page is to get everything running under Linux 64bit too until the next official release supporting again Linux.
Thanks to Bastiaan for his help!


You first need Java. I'm using OpenJDK 1.6

apt-get install openjdk-6-jre

Needed components are eclipse-platform & eclipse-jdt

apt-get install eclipse

Follow tools instructions to install JCOP plugins

Eclipse activation:
We'll see later how to use a real reader via jpcsc but for activation it doesn't work so better to use one of the other activation methods for now.


  • Windows / Preferences / Java / Compiler / Compliance Level: 1.5
  • Windows / Preferences / Java / Debug / Unselect "Suspend Execution on uncaught exceptions"


There are still a couple of linux simulators available in the tools but not much.
You can see them in Debug/Run Configurations... / JavaCard Application / JavaCard Simulation / Configure. At time of writing, only v2.3.1 and v2.4.1R3 are available.
But... the other simulators for Windows work fine through wine.
So you can create in all ~/.eclipse/org.eclipse.platform_3.7.0_*/plugins/*/linux/ a script jcop to use the Windows version:

wine $(dirname $0)/../win32/jcop.exe $*

So corresponding versions will appear in JavaCard Simulation configuration.

Simulators can also be run alone, for use with JCShell or jcop_simul_ihdhandler:

sh ~/.eclipse/org.eclipse.platform_3.7.0_.../plugins/ \

A couple of scripts to ease usage of the various simulator versions:

simulators/template (you can download it by using this link):

REF=$(basename $0)
FAB=$(ls $HOME/.eclipse/org.eclipse.platform_3.7.0_*/plugins/$MASK/$REF.dat)
$SIM -fab=$FAB
chmod 755 template

simulators/populate (you can download it by using this link):

$ cat populate 
rm mask*
for i in $HOME/.eclipse/org.eclipse.platform_3.7.0_*/plugins/*/mask??_*; do
    REF=$(basename $i)
    ln -sf template $REF
for i in $HOME/.eclipse/org.eclipse.platform_3.7.0_*/plugins/*; do
    cd $i
    if [ -d linux ]; then
    mkdir linux
    cat > linux/jcop << EOF
wine \$(dirname \$0)/../win32/jcop.exe \$*
    chmod 755 linux/jcop
chmod 755 populate


Eclipse plugin contains also a standalone jcshell version but the Bash script provided with it (~/.eclipse/org.eclipse.platform_3.7.0_155965261/plugins/ can be improved, e.g. by replacing it at the same location by the following (you can download it by using this link):

# ==========================================================================
#     This file launches the NXP JCShell for command line usage
# ==========================================================================
# --------------------------------------------------------------------------
# Check for java
# --------------------------------------------------------------------------
if [ "$JAVA_HOME" != "" ]; then
    if [ -x "$JAVA_HOME/bin/java" ] ; then
	echo "ERROR : JAVA_HOME not properly defined. Could not find java."
	exit 1
    JAVA="$(which java)"
    if [ "$JAVA" = "" ]; then
	echo "ERROR : Could not find java in PATH. Please define JAVA_HOME."
	exit 1
# --------------------------------------------------------------------------
# Extract jcshell absolute path no matter from where it's called
# --------------------------------------------------------------------------
JCSHELL_PATH="$(dirname $(readlink -f $0))"
# --------------------------------------------------------------------------
# Include the JAR files from lib folder in CLASSPATH for JVM
# --------------------------------------------------------------------------
# --------------------------------------------------------------------------
# Launch the JVM with jcshell as main application and pass in the command
# line from the call to this script file.
# --------------------------------------------------------------------------
echo Welcome to NXP JCShell!
echo "(c) 2012 NXP Semiconductors Germany GmbH"
echo ------------------------------------------------------------------------------
if [ "$(which socat)" != "" ]; then
        socat READLINE,history=$HOME/.jcshell_history EXEC:"\"$JAVA\" -cp \"$CLASSPATH_JCSHELL\" $*"
        "$JAVA" -cp "$CLASSPATH_JCSHELL" $@

In case you want to use only the simulators and you don't have JPCSC (see below), comment the line


Now you can create a symlink at your convenience, e.g.

ln -s ~/.eclipse/org.eclipse.platform_3.7.0_155965261/plugins/ /usr/local/bin/jcshell

Note that to use a jcshell.rc file, it needs to be present in the local directory (pwd).

And connecting to a standalone JCOP simulator:

- /term Remote
> /atr
> /identify

In the script above, we look for socat and it present, we use it to add current line edition capability in a bash like manner (READLINE) and use of a history file .jcshell_history.

It's also possible to get JCShell from the standalone version, using the setup executable:

7z -y x nxp-offcard-

You'll get a /scripts directory in which we'll only consider a few jar files.
The same script can be used in this setup.


Pegoda doesn't work under linux but we can use PCSC readers through JPCSC.
JPC/SC Java API (0.8.0) is available in binary form in the link Windows Binary Download Here (zip)
Yes I know... Windows... but contains also /jpcsc/bin/linux/, a 32 bit library.
On a 64 bit Debian, you can put under /usr/lib32

ldd /usr/lib32/
[...] => not found

Indeed libpcsclite1 is not in the ia32-libs
You can get it by retrieving the 32 bit version of libpcsclite1 which you already have on your system. For me it's libpcsclite1_1.8.3-3_i386.deb.
Get it, extract libpcsclite1_1.8.3-3_i386.deb and copy and symlink to /usr/lib32

Now PCSC readers can be used under JCShell if you add jpcsc.jar to the helper script:

java -cp "lib/offcard.jar:lib/crypto.jar:lib/jpcsc.jar" $*
- term PCSC
> /atr

It will find the card, no matter in which PCSC reader it is.
And with e.g. a SCL3711 it will access contactless JCOP cards without any problem.

For Eclipse, simply choose the right PCSC reader under Debug/Run Configurations


Ifdhandler in release of jpcsc binaries is 32-bit so we've to recompile it from sources

cd jpcsc/misc/jcop_simul_ifdhandler
gcc -g -fpic -w  -c ifdhandler.c -I. 
gcc -g -fpic -w -shared ifdhandler.o -o

Then install in /usr/lib/pcsc/drivers/serial/ and create a conf file /etc/reader.conf.d/jcopsimul:

LIBPATH          /usr/lib/pcsc/drivers/serial/
CHANNELID        0x0103F8

Note the difference with original instructions from README: since pcsc-lite 1.6.5 you shouldn't use DEVICENAME if the driver does not provide IFDHCreateChannelByName()
Finally restart pcscd
Every time a simulator will be run, a "card" will be inserted in pcscd
The virtual card can be used with any PCSC-compatible application, including Eclipse.

Beware that once pcscd is running and using ifdhandler JCOPSimulReader, simulator cannot be accessed anymore via

/term Remote

but exclusively via

/term PCSC


RFIDIOt contains a few tools linked to JCOP

Could never get it working properly


GlobalPlatform tool intends to replace outdated gpshell.
To compile it you need openjdk-7-jdk which at the moment seems hard to get on my Debian (old dependencies problem), so I'll stick to openjdk-8 and fetch a pre-built version here.

java -jar gp.jar --help



Personal tools