Usage of javax.smartcardio package in eclipse

Hi ,
how to use this package (javax.smartcardio) in eclipse env

Hi,
Can you give more details about your issues? Have you searched the forum/web for examples?
Cheers,
Shane

Similar Messages

  • Javax.smartcardio package not found in Java source file

    I downloaded the latest JDK from developer.apple.com, but now I cannot find the javax.smartcardio package in the source package (src.jar) that came with it. I unpacked the JAR file, but simply can't find the stated package. Can you help me out?

    I can confirm the issue here (Mountain Lion, 10.8.5). A very simple program (attached below) that just enumerates terminals and checks if a card is present will crash:
    If Apple JDK6 is used in 64-bit mode (without supplying the -d32 argument)
    If Oracle JDK7 is used (can not switch to 64-bit, uses)
    It will work if:
    If Apple JDK6 is forced into 32-bit mode using -d32
    If Oracle JDK7 version of libj2pcsc.dylib is replaced with a patched version
    javax.smartcardio on Mac OS X is in a truly sad state. :-(
    Can anyone suggest alternatives for Smartcard communication on Mac OS X fat clients?
    package com.example.smartcardio;
    import javax.smartcardio.CardTerminal;
    import javax.smartcardio.CardTerminals;
    import javax.smartcardio.TerminalFactory;
    public class TestWaitForChanges {
              public static void main(String[] args) throws Exception {
                        CardTerminals terminals = TerminalFactory.getDefault().terminals();
                        while (true) {
                                  for (CardTerminal terminal : terminals.list()) {
                                            System.out.println("Checking terminal: " + terminal.getName());
                                            System.out.println("Card present: " + (terminal.isCardPresent() ? "YES" : "NO"));
                                  System.out.println("Waiting for changes...");
                                  terminals.waitForChange();

  • Help me - I have a problem of using the javax.smartcardio

    Hi everybody!!!
    I'm creating an application to communicate with javacard.
    I searched on internet and know about javax.smartcardio.
    But I can not use it, even it's inside the default library of Java 6.
    I already import the javax.smartcardio.*; to my java file.
    But it can not find the class inside this package.
    Can somebody help me? Thanks a lot.

    Hi everybody.
    I got the advice from Mr. Safarmer on this forum.
    So:
    If you're using Eclipse to develop the application.
    You have to set the JRE Library to Alternate JRE.
    Below is the instruction for dummies like me ^^:
    Go to Build Path > Configure Buil Path of your project
    In Libraries tab, Edit the JRE System Library
    Instead of choosing the Execution Environment, we choose Alternate JRE (usually jre6)--> This is my case. And i did it.

  • Where can I find WebLogic JAR including javax.annotation package?

    Hello.
    I'm writing and testing WebLogic EJB 3.0 sample through the edocs.bea.com
    Most samples in edocs use javax.annotation package, but I couldn't find any of javax.annotation package in jars of %WEBLOGIC_HOME%\server\lib folder.
    I want to use it such as javax.annotation.PreDestroy, javax.annotation.Resource etc.
    I'm using WebLogic 10.0 and Eclipse 3.3.
    Where can I find a jar include javax.annotation package?
    Thanks in advance.
    Edited by ienvyou at 12/11/2007 6:30 PM

    BEA_HOME\modules\javax.annotation...
    Edited by li_shen at 12/11/2007 10:26 PM

  • Java 6: javax.smartcardio - can't get CPLC

    Hello! I have a problem - can't get CPLC with classes from javax.smartcardio (get SW=6a88), but I easily get it with com.sun.javacard.apduio classes from Java Card Kit 2.2.2.
    Here the test code for javax.smartcardio :
    import java.util.List;
    import javax.smartcardio.*;
    public class TestSmartCardJSE60
    public static void main(String[] args)
      try
       TerminalFactory tf = TerminalFactory.getInstance("PC/SC", null);
       CardTerminals cts = tf.terminals();
       List<CardTerminal> avaiableTerminals = cts.list();
       CardTerminal ct = avaiableTerminals.get(0);
       Card card = ct.connect("*");
       try
        CardChannel channel = card.getBasicChannel();
        CommandAPDU capdu = new CommandAPDU(0x80, 0xCA, 0x9F, 0x7F);
        ResponseAPDU res = channel.transmit(capdu);
        System.out.printf("%s%n", res);
       finally
        card.disconnect(true);
      catch(Exception e)
       e.printStackTrace();
    }And here the same for com.sun.javacard.apduio
    import com.sun.javacard.apduio.*;
    public class TestSmartCardJCK222
    public static void main(String[] args)
      try
       CadClientInterface cad = CadDevice.getPCSCClientInstance(0);
       cad.powerUp();
       try
        Apdu capdu = new Apdu();
        capdu.command[Apdu.CLA] = (byte) 0x80;
        capdu.command[Apdu.INS] = (byte) 0xCA;
        capdu.command[Apdu.P1] = (byte) 0x9F;
        capdu.command[Apdu.P2] = 0x7F;
        cad.exchangeApdu(capdu);
        System.out.printf("%s%n", capdu);
        capdu.setLe(0x2D);
        cad.exchangeApdu(capdu);
        System.out.printf("%s%n", capdu);
       finally
        cad.powerDown(true);
      catch(Exception e)
       e.printStackTrace();
    }I run both tests under WindowsXP SP3 with ORGA ECO5000 Usb and JCOP21 smart card.
    What is my problem? Actualy I want to use javax.smartcardio for my application, because classes from that package more useful than com.sun.javacard.apduio;
    Any ideas?

    You're missing the Le byte, since you're expecting data back. Try it.

  • How to get a handle which is used in c dll from  javax.smartcardio.card

    good afternoon
    i am using javax.smartcardio.card to operate a sim-card reader .
    but i have a dll which is call sim-card reader by handle.
    how can i get a handle from a javax.smartcardio.card object to pass to the dll
    next is the code .
    c dll prototype declaration
    char DoFormat([in] unsigned long P1�C[in] char * P2�C[in] bool P3,[in][out] char *P4)P1 is a handle
    java code:
    private boolean checkCardReader(boolean isopen)
    boolean r=false;
    try {
    javax.smartcardio.card card;
    TerminalFactory factory = TerminalFactory.getDefault();
    List terminalList = factory.terminals().list();
    terminal = (CardTerminal) terminalList.get(0);
    // establish a connection with the card
    card = terminal.connect("T=0");
    channel = card.getBasicChannel();
    //how can i get a handle which can be used by windows dll .
    }catch (Exception ex)
    System.out.println("Exception : " + ex);
    return r;
    *****************************************************************

    Presumably you are calling a C library method that returns a handle.
    Normally a handle will be a integer type value.
    With such a value you can cast it into a java integer type and then cast it back in different JNI code by passing it to those routines.
    A java long is as big as you can get and will hold most every normal type handle item. You should however verify sizes.

  • Help need in javax.smartcardio.exception

    getting error
    javax.smartcardio.CardException: sun.security.smartcardio.PCSCException: Unknown error 0xc000002b
    at sun.security.smartcardio.ChannelImpl.doTransmit(ChannelImpl.java:202)
    at sun.security.smartcardio.ChannelImpl.transmit(ChannelImpl.java:73)
    while setting pin limit in the card.
    Please help what is the cause of getting this error.
    thanks in advance

    First you should check that the library has the checkbox 'Deploy by default' is checked for your library.
    The you open the project properties of the view controller project, select Deployments, edit the deployment descriptor. Select the Node 'File Groups'->'WEB-INF/lib'->'Contributors'. this should give you a list of libraries your project uses. Check if your library has the checkbox checked (is selected fro deployment). If it's not checked, set it.
    This should include the library.
    Timo

  • Error when using javax.script package

    Hi
    I want to call a javascript method from a .js file from .java class.
    when i searched, i came to understand that using jdk1.6 i can use javax.script package tht provide me what i needed.
    using the reply i got from i earlier post, i tried one example.
    public void show() {
    ScriptEngineManager engineMgr = new ScriptEngineManager();
    ScriptEngine engine= engineMgr.getEngineByName("JavaScript");
    try {
    engine.eval(new FileReader("D:/ShowScript.js"));
    Invocable invocableEngine = (Invocable) engine;
    //show_message is my function in ShowScript.js file
    invocableEngine.invokeFunction("show_message",null);
    } catch (Exception e) {
    e.printStackTrace();
    ShowScript.js
    function show_message()
    println("===> hi");
    alert("hi");
    When i execute my program, im getting the following error
    javax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "alert" is not defined. ( #8) in at line number 8
    at com.sun.script.javascript.RhinoScriptEngine.invoke(RhinoScriptEngine.java:184)
    at com.sun.script.javascript.RhinoScriptEngine.invokeFunction(RhinoScriptEngine.java:142)
    at testbuiltin.backing.Show_alert.show(Show_alert.java:81)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.sun.el.parser.AstValue.invoke(AstValue.java:151)
    at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
    When i remove the alert() from the js file, the println is working. But what i neede is the alert.
    Can anyone plz help me to solve this problem.

    As you're talking about "backing beans", are you using JSF?
    After all, this is definitely not the way to let Java and JS interact with each other. Java runs at the server side. JS runs at the client side. Java can write JS code to the response, but definitely cannot call it. JS can access the HTML DOM and invoke requests to the server (form.submit() and AJAX and so on) and send parameters along the request, but definitely cannot call Java classes and methods independently. Nothing more and nothing less than that.

  • Best Practice: Usage of the ABAP Packages Concept?

    Hi SDN folks,
      I've just started on a new project - I have significant ABAP development experience (15 years+) - but one thing that I have never seen used correctly is the Package concept in ABAP - for any of the projects that I have worked on.
    I would like to define some best practices - about when we should create packages - and about how they should be structured.
    My understanding of the package concept is that they allow you to bundle all of the related objects of a piece of development work together. In previous projects - and almost every project I have ever worked on - we just have packages ZBASIS, ZMM, ZSD, ZFI and so on. But this to me is a very crude usage of packages, and really it seems that we have not moved on passed the 4.6 usage of the old development class concept - and it means that packages do not really add much value.
    I read in the SAP PRESS Next Generation ABAP book (Thomas Ljung, Rich Hellman) (I only have the 1st edition) - that we should use packages for defining separation of concern for an application. So it seems there they are recommending that for each and every application we write - we define at the least 3 packages - one for Model, one for Controller and one for view based objects. It occurs to me that following this approach will lead to a tremendous number of packages over the life cycle of an implementation, which could potentially lead to confusion - and so also add little value. Is this really the best practice approach? Has anyone tried this approach across a full blown implementation?
    As we are starting a new implementation - we will be running with 7 EHP2 and I would really like to get the most out of the functionality that is provided. I wonder what others have for experience in the definition of packages.
    One possible usage occurs to me that you could define the packages as a mirror image of the application business object class hierarchy (see below). But perhaps this is overcomplicating their usage - and would lead to issues later in terms of transportation conflicts etc.:
                                          ZSD
                                            |
                    ZSOrder    ZDelivery   ZBillingDoc
    Does anyone have any good recommendations for the usage of the ABAP Package concept - from real life project experience?
    All contributions are most welcome - although please refrain from sending links on how to create packages in SE80
    Kind Regards,
    Julian

    Hi Julian,
    I have struggled with the same questions you are addressing. On a previous project we tried to model based on packages, but during the course of the project we encountered some problems that grew overtime. The main problems were:
    1. It is hard to enforce rules on package assignments
    2. With multiple developers on the project and limited time we didn't have time to review package assignment
    3. Devopelers would click away warnings that an object was already part of another project and just continue
    4. After go-live the maintenance partner didn't care.
    So, my experience is is that it is a nice feature, but only from a high level design point of view. In real life it will get messy and above all, it doesn't add much value to the development. On my neew assignment we are just working with packages based on functional area and that works just fine.
    Roy

  • Error using javax.mail package

    Hi,
    I have included the package javax.mail.* in my code.I have downloaded
    jaf 1.0.2 and javamail 1.1.3 from the Sun Microsystems website.
    When i try to compile my code i get the error message:
    com/voxspectrum/ccvox/EmailServer.java:55: cannot resolve symbol
    symbol : class MimeMessage
    location: class com.voxspectrum.ccvox.EmailServer
    javax.mail.Message msg = new MimeMessage(session);
    I am using JDK ver 1.3.1_02. What should i set my path and classpath as, if i am using javax.mail package?
    Please could you help me out with this problem!

    Hi Nisha
    You need to include the path to the mail.jar and activation.jar files in your classpath.
    How you do it depends on the OS you are running on
    in Windows 95 /98 the easiest way is to edit the autoexec.bat file and add the settings to your already existing classpath statement i.e.
    set CLASSPATH=%CLASSPATH%;C:\richard\javamail-1.3\mail.jar C:\richard\jaf-1.0.2\activation.jar
    (excuse the word wrapping) then reboot
    on Linux / Solaris edit the .profile file for your user and set the CLASSPATH variable to
    CLASSPATH=$CLASSPATH:<pathtofile>/mail.jar:<pathtofile>/activation.jar
    export CLASSPATH
    and that should do it
    Hope this helps

  • How to get free memory size of a card with javax.smartcardio

    Hi,
    How can I find how much memory of a card is free with javax.smartcardio?
    Please your advice.
    Thank in advance.

    gizmo wrote:
    I wanted to read the free memory size with a card reader and javax.smartcardio.
    Is it possible to send a APDU Command to select the root 3F00 and read the properties?There is no built-in smartcardio funationality to do this. What you can do is send an APDU and get the memory by calling the code mentioned already.

  • Problem with package in Eclipse

    I am doing in Java codes. There is big problem with those error:
    package org.eclipse.emf.ecore.xml.type.internal;What I should to do that? Do you think I need to download some package from somewhere for Eclipse?
    I have already Eclipse. Please help me how to do that. Thanks.

    I wrote codes in there. But there is some errors in there because they said that I don't have package exist in Eclipse. I have no idea why.
    Those lists below got red line:
    package org.eclipse.emf.ecore.xml.type.internal;
    import org.eclipse.emf.common.util.WrappedException;
    import org.eclipse.emf.ecore.xml.type.InvalidDatatypeValueException;
    import org.eclipse.emf.ecore.xml.type.util.XMLTypeUtil;I tried to run it and the errors said:
    InvalidDatatypeValueException cannot be resolved to a type.
    The declared package "org.eclipse.emf.ecore.xml.type.internal" does not match excpected package"
    The import org.eclipse cannot be resolved
    WrappedException cannot be resolved to a type
    XMLTypeUtil cannot be resolved{code}
    What is wrong with it? Do you think there is missing plugin package or what? Where can I find a package for that?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Problem with APDUCommand in javax.smartcardio

    Hi,
    There seem to be a bug (from my point of view) with the javax.smartcardio when i attempt to send a command over to the card.
    There a code frag
    factory = TerminalFactory.getDefault();
            try {
                terminals = factory.terminals().list();
                System.out.println("Terminals: " + terminals);
                terminal = terminals.get(1);
                System.out.println("Card Present: " + terminal.isCardPresent());
                Card card = terminal.connect("*");
                channel = card.getBasicChannel();
                ResponseAPDU resp = channel.transmit(new CommandAPDU(selectcom));
                System.out.println("Select Resp: " + getHexString(resp.getBytes()));
                CommandAPDU com = new CommandAPDU((byte)0x43, (byte)0x52, (byte)0x00, (byte)0x00, 0);
                System.out.println("CommandAPDU: " + getHexString(com.getBytes()));
                resp = channel.transmit(com);
                System.out.println("Result: " + getHexString(resp.getBytes()));
                card.disconnect(false);
            } catch (CardException e) {
                e.printStackTrace();
            }There the result:
    Terminals: [PC/SC terminal OMNIKEY CardMan 5x21 0, PC/SC terminal OMNIKEY CardMan 5x21-CL 0]
    Card Present: true
    Select Resp: 90 00
    CommandAPDU: 43 52 00 00
    Result: 6E 00
    BUILD SUCCESSFUL (total time: 1 second)
    And there the result i tried with another tool (GPShell)
    select -AID 53504545454659503101
    --> 00A404000A53504545454659503101
    <-- 9000
    send_apdu -sc 0 -APDU 43520000
    Send APDU: 43 52 00 00
    --> 43520000
    <-- 9000
    Recv APDU: 90 00
    card_disconnect
    release_context
    Anyone have encounter the same problem?

    Refering to this code:
    factory = TerminalFactory.getDefault();
            try {
                terminals = factory.terminals().list();
                System.out.println("Terminals: " + terminals);
                terminal = terminals.get(1);
                System.out.println("Card Present: " + terminal.isCardPresent());
                Card card = terminal.connect("*");
                channel = card.getBasicChannel();
                ResponseAPDU resp = channel.transmit(new CommandAPDU(selectcom));
                System.out.println("Select Resp: " + getHexString(resp.getBytes()));
                CommandAPDU com = new CommandAPDU((byte)0x43, (byte)0x52, (byte)0x00, (byte)0x00, 0);
                System.out.println("CommandAPDU: " + getHexString(com.getBytes()));
                resp = channel.transmit(com);
                System.out.println("Result: " + getHexString(resp.getBytes()));
                card.disconnect(false);
            } catch (CardException e) {
                e.printStackTrace();
            }ResponseAPDU resp = channel.transmit(new CommandAPDU(selectcom));
    I already selected the applet here.
    With this command here
    static byte[] selectcom = new byte[] {(byte)0x00, (byte)0xA4, (byte)0x04, (byte)0x00, (byte)0x0A, (byte)0x53, (byte)0x50, (byte)0x45, (byte)0x45, (byte)0x45, (byte)0x46, (byte)0x59, (byte)0x50, (byte)0x31, (byte)0x01};
    So selecting the applet is done. And it return a 90 00. Then i start to send applet specific command.
    =)

  • Javax.servlet package

    hi i am using netbeans but i want to deploy some servlets in my mobile application but i am getting problem in accessing javax.servlet package. can anyone tell me where can i get this one. my application is stuck now ......plz reply me fast...... i search a lot i got the specs of it but not the api.

    I wonder what you're trying to do.
    In my case, I have installed Tomcat 5.0. This installation included a jar file containing the different servlet classes I need to develop servlets. This jar file is in the folder C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib.
    I did not need to move the jar files from Tomcat to the folder of my J2SDK.
    But I had to add en environment variable under Windows XP, namely CATALINA_HOME to let the computer know where the folder of Tomcat was. With this variable, the jar file containing the classes for servlet programming can be found.

  • Import javax.mail package does not exists

    Hi,
    when i tried to compile the source code for email using jdk1.3.1, it compiled fine. but when i tried to compile using jdk1.4.., it had the following errors such as
    import javax.mail package does not exists,
    import javax.mail.internet package does not exists
    package javax.activation does not exist
    Is it because of the jdk version problem???
    Pls help me

    I have the same problem with javax.ejb
    Now i've downloaded and installed the j2ee and set my classpath to the j2ee.jar. I've had to make a new path cause i'm running XP.
    This doesn't work.
    to compile it in Jcreator or JBuilder I can make it work by adding this package (j2ee.jar) in the project settings - required libraries.
    But I have to do this for every project again and again.
    I can make it work but i thougt the classpath would be enough ??
    Bassegio

Maybe you are looking for

  • Why can't I use my iMessage on my iPod touch?, Why can't I use my iMessage on my iPod touch?

    I need help with at I can't use my iMessage with my iPod touch it won't let me . Can you please help me fix this?

  • Adding Pause and Replay Buttons

    Ok here is my script for an external XML loading Flash Gallery... 1. How do I add a "constant" Pause and Replay on this? 2. Every time I add something to the stage the "fade effect" affects that too! Thanks in advance. delay = 5000; function loadXML(

  • BARS sizing for UCCX 7

    Can anyone provide the methodology to determine how much disk space to reserve for the BARS tar files? Thanks, Terry

  • Slices Issue

    I believe my issue has something to do with page tiling or page setup of some sort. When I go to make a slice it is like I am hitting a boundary that won't allow the slice to be the size I want it to be. The artwork is inside the art box but there se

  • Organizing music and program explanat

    Hello,I just got a Creative Zen M (30gb) and had a few questions.() can someone explain the three different programs that got downloaded: organizer, manager, media source...(2) A bunch of my songs got synchronized already onto my MP3, but if i would