How to run a library in Java Card

Hi guys
I have a question related to the running in emulator. Well, I now have 2 separated projects, one is class library and the other is java card applet. Both of them are constructed by Netbeans
When I build the classic library, it is fine. I have class file, cap file and export file of this package. This is the source code of my class library
package lib4;
public class lib4 {
    public short func1(){
        return (short)0x1234;
}And then, I use this library for the java card applet which is developed onto another project in Netbeans as well. This applet invokes func1 in class lib4. This is the source code of the applet
package app1;
import javacard.framework.*;
import lib4.*;
public class app1 extends Applet {
    public static void install(byte[] bArray, short bOffset, byte bLength) {
        new app1();
    protected app1() {
        register();
    public void process(APDU apdu) {
        //Insert your code here
        short t;
        lib4 d= new lib4();
        t = d.func1();
        ISOException.throwIt((short)t);
}However, when I build this applet by Netbeans, the error is "error: export file lib4.exp of package lib4 not found.". I think that's fine if I build them by ANT TASK. Nervertheless, for the sake of emulating, I want to build them onto Netbeans.
This is the whole result of the build
init-platform-properties:
Using JavaCard Platform Definition at C:\Documents and Settings\chandufo\.netbeans\6.9\config\Services\Platforms\org-netbeans-api-java-Platform\javacard_default.jcplatform
Java Card Home is C:\Program Files\NetBeans 6.9\javacard\JCDK3.0.2_ConnectedEdition (Java Card Platform)
init-ri-properties:
init-device-properties:
Platform device property name is jcplatform.javacard_default.devicespath
Computed device folder path is C:\Documents and Settings\chandufo\.netbeans\6.9\config\org-netbeans-modules-javacard\servers\javacard_default
Platform device file path property name is C:\Documents and Settings\chandufo\.netbeans\6.9\config\org-netbeans-modules-javacard\servers\javacard_default\Default Device.jcard
Deploying to device Default Device http port 8019
init-keystore:
Keystore is C:\Program Files\NetBeans 6.9\javacard\JCDK3.0.2_ConnectedEdition/samples/keystore/a.keystore
build-dependencies:
unpack-dependencies:
compile:
Compiling 1 source file to D:\netbean\app1\build\APPLET-INF\classes
compile-proxies:
create-descriptors:
create-static-pages:
do-pack:
Resolved dist.bundle as relative file D:\netbean\app1\dist\app1.cap
Resolved build.dir as relative file D:\netbean\app1\build
Packager [v3.0.2]
    Copyright (c) 2009 Sun Microsystems, Inc.
    All rights reserved.
    Use is subject to license terms.
[ INFO: ] Validating Command Line
[ INFO: ] Setting packaging information
[ INFO: ] Package is being created
[ INFO: ] Converter [v3.0.2]
[ INFO: ]     Copyright (c) 2009 Sun Microsystems, Inc.
    All rights reserved.
    Use is subject to license terms.
[ INFO: ] conversion completed with 1 errors and 0 warnings.
error: export file lib4.exp of package lib4 not found.
D:\netbean\app1\nbproject\build-impl.xml:205: Creation of D:\netbean\app1\dist\app1.cap was not successful. See Packager output
BUILD FAILED (total time: 1 second)-->> What can I do now?
Any kinds of help will be appreaciated.

First things first.
Do you know how to compile a simple hello word program, get it to compile, and run it in jbuilder? Do you know how to do other basic programming tasks (ignoring iADF for now) in the IDE? If not, you need to concentrate on how to use jbuilder before messing with Oracle ADF (Oracle Application Development Framework). Alternately, if you are very familiar with another IDE such as Eclipse, you can look at ADF plugins for it instead (if they exist). If you are not familiar with Java, its supporing technologies, and an IDE very well, I suggest you drop ADF and work on simpler architectures because ADF is way, way too advanced for you at this time. Instead, spend your time reading books on Java, etc from cover to cover and working through a number of their examples instead.
Assuming you are an experienced programmer and plan to go ahead with ADF, I suggest you go to amazon.com and order a book on ADF that has good reviews. Read it from cover to cover and work through a number of the book's examples. You should start out with a very very simple ADF project before attempting something more complicated, then build on it. If you are not familiar with some of the components of ADF such as JSF, I suggest you create a few simple projects using them in isolation before combining them all under ADF.

Similar Messages

  • How to run ear file in java application server

    i want how to run .ear file in java application server
    1. i m created ear file
    2. i m created jar file (bean,home,remote)
    3.i m created war file(in the form of jsp)
    but till now i couldnt run ear file
    how to run
    please hel me

    You must create :
    1.Jar file
    2.War file
    And then put them into an ear file
    Exemple : myapp.ear contains
    myappEJB.jar
    myappWEB.war
    META-INF/application.xml
    and application.xml looks like this :
    <application xmlns="http://java.sun.com/xml/ns/j2ee" version="1.4"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com /xml/ns/j2ee
                            http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
        <display-name>myapp</display-name>
        <description>Demo application</description>
        <module>
            <ejb>myappEJB.jar</ejb>
        </module>
        <module>
          <web>
             <web-uri>myappWAR.war</web-uri>
             <context-root>/myapp</context-root>
          </web>
        </module>
    </application>Good luck

  • How to run native program with Java program?

    Hello
    I've got following problem. I'd like to write file browser which would work for Linux and
    Windows. Most of this program would be independent of the system but running programs not. How to run Linux program from Java program (or applet) and how to do it in Windows?.
    Cheers

    Try this:
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec("ls -l");
    InputStream stream = proc.getInputStream();
    InputStreamReader isr = new InputStreamReader(stream);
    BufferedReader br = new BufferedReader(isr);
    String line = null;
    while ( (line = br.readLine()) != null) .....
    "if the program you launch produces output or expects input, ensure that you process the input and output streams" (http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html)

  • How do run my library from an external drive?

    How do run my library from an external drive? I've tried changing destination locations but nothing seems to work. help please

    You might find this article useful, there's a section in it on moving to an external drive:
    iLounge - Transferring your iTunes Library to Another Drive

  • How to run SQL files from Java?

    Hi,
    Can someone point me towards a link on how to run sql files in Java? Thanks.
    P.S...if I've been completely blind please go easy on me!

    Sorry forgot the formating code thingy
    public static boolean executeScript(File script, Connection conn){
        boolean success = true;
        success = script.exists();
        if(success){
          DEBUG.print("ES::READING SCRIPT:" + script.getAbsolutePath());
          StringBuffer buffer = new StringBuffer();
          success=readScript(script,buffer);
          if(success){
            try{
              String creationScript = buffer.toString();
              Statement st = conn.createStatement();
              int start = 0;
              int end = 0;
              while (end != -1 && start < creationScript.length()) {
                end = creationScript.indexOf("GO", start);
                if (end != -1) {
                  DEBUG.print(creationScript.substring(start, end));
                  st.executeUpdate(creationScript.substring(start, end));
                  start = end + 2; //2 is the length of "GO"
              st.close();
            }catch(Exception e){
              success=false;
              DEBUG.printStackTrace(e);
        }else{
          DEBUG.print("ES::SCRIPT FILE DOES NOT EXISTS");
          success=false;
        return success;
      public static boolean readScript(File script, StringBuffer buffer){
        boolean success = true;
        DEBUG.print("RS:: reading file :" + script.getAbsolutePath());
        try{
          InputStreamReader isr = new InputStreamReader(new FileInputStream(script),"UTF16");
          int ch;
          while ( (ch = isr.read()) > -1) {
            buffer.append( (char) ch);
          if (isr != null)
            isr.close();
        }catch(Exception e){
          success=false;
          DEBUG.printStackTrace(e);
        return success;
      }

  • How to run perl file from java file..???

    Hi All,
    How to run a perl file from java file.I know that there is one JPL(Java-Perl Library) preprocessor which can be used to do this,but no idea of how to do it..
    Any help is appreciated.
    Thanks in advance.

    viswa07 wrote:
    Ok and any idea regarding JPL..????I don't know it and the first few posts that I found mentioned it using Java 1.1-style JNI calls, which hints at a dead project. And you don't want to use a dead project.

  • How do run unix command in java

    hi
    All unix command working fine in our java program.
    but i want change user in linux by using java. it's not working.
    "su root" This command onely not working.
    anybody know help me
    This is my ID [email protected]
    This my code
    <% String s = null;
    try{
    Process p = Runtime.getRuntime().exec("su root");
    BufferedReader stdInput = new BufferedReader(new
    InputStreamReader(p.getInputStream()));
    BufferedReader stdError = new BufferedReader(new
    InputStreamReader(p.getErrorStream()));
    out.println("Here is the standard output of the command:\n");
    while ((s = stdInput.readLine()) != null)
    out.println(s);
    catch(Exception e) {}
    %>

    I don't have further info to add to your first post, but think your guess seems quite reasonable. I thought of starting a new thread on the same topic, but think this (question) fits in here, too.
    I have Java code (freeware, not opensoure), intended for Unix, which basically provides the graphical interface and relies on an I/O layer (C + shell scripts) to do most of the work. I have access to the C+shell scripts which are opensource. I ported it to Cygwin and want to use it under Windows (there is no Cygwin native Java VM).
    My problem now boils down to " how to run commands under Unix and what differences are there with Windows". What are the variants?
    I have to guess what the program is doing when I get an IOException at some point. E.g.: a call to shell script may be made in a different way as to a compiled exe in Unix?. I found a way to bypass path problems because forward slashes are also accepted and /cygdrive/c construct can be replace by c:/; shell scripts can be compiled into exes using shc and they work; if symbolic links are replaced by duplication of exe files, they work. What will happen in an instance whereby a process runs a shell script dynamically, through a pipe (the shell script is compiled in the Cygwin/win version and receives parameters) in a construct like:
    pipefp = epopen(cmdbuf,"w"); /* (cmbuf is "makehdr par1 par2 ... ") (makehdr was a shell script and is now compiled exe for Cygwin/Windows) */?.
    Thanks.
    LT

  • How SDA and DDA works in Java Card?

    Hi Friends,
    I want to know how exactly SDA and DDA works in Java Card technology..
    Yes, i know that SDA (Static Data Authentication) is valid for every transactions, but the key used is always same for every transaction made..
    and DDA (Dynamic Data Authentication) uses dynamic key for every transactions, it means that one key is valid for one transaction..
    But, i'm a little bit confused how this is implemented in Java Card..
    Is it related with SCP01 and SCP02?..
    Please help me regarding this..
    Thanks in advance

    Hi,
    I want to know how exactly SDA and DDA works in Java Card technology..This is an EMV concept and as such is not implemented in Java Card as such. You would have to create an implementation to be able to use SDA and DDA.
    But, i'm a little bit confused how this is implemented in Java Card..
    Is it related with SCP01 and SCP02?..It is not implemented natively in Java Card and are not related to SCP. SDA and DDA are for the EMV card application (card application data updates) and SCP is for the card manager (card content updates). While they could be considered similar concepts, they are not related in a Java Card sense.
    Cheers,
    Shane

  • How to run .html file from .java file..?

    Hi All,
    I was just trying as mentioned in the subject of how to run an html file from a java file.We have runtime class which inturn is having exec method which returns process but it supports only .exe as an argument .Is there any way to do this???
    Thanks in advance.

    viswa07 wrote:
    You mean to say Desktop class in java...???I'm so sorry, I thought you knew enough Java to look up the API.
    [This link|http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.html] might be more at your level.
    db

  • How to run DOS command in Java environment?

    Can i run DOS command in Java environment?
    I did like this:
    Runtime r = Runtime.getRuntime();
    r.exec("cmd.exe");
    r.exec("set classpath=%CLASSPATH%;.\\tmp")
    but failed.
    However if I run the java command, it runs successfully.
    r.exec("javac Test.java");
    r.exec("java Test");
    how should I do so that i can run the DOS commands metioned above in Java Environment?
    thanks a lot.

    Have a look at http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
    This may help. I wonder if this is ok ?
    Runtime r= Runtime.getRuntime();
    r.exec("cmd.exe /C set classpath=%CLASSPATH%;.\\tmp\"");

  • How to run a project in java

    hi all
    i am new to jdevelper and adf.
    really i need help i created a project and now i want to run it
    but i do not know how to run it
    my jdeveloper 11g R1 and i also compile the project and its showing me successful compilation
    0-error and 0 warngs....
    plz guide me.

    First things first.
    Do you know how to compile a simple hello word program, get it to compile, and run it in jbuilder? Do you know how to do other basic programming tasks (ignoring iADF for now) in the IDE? If not, you need to concentrate on how to use jbuilder before messing with Oracle ADF (Oracle Application Development Framework). Alternately, if you are very familiar with another IDE such as Eclipse, you can look at ADF plugins for it instead (if they exist). If you are not familiar with Java, its supporing technologies, and an IDE very well, I suggest you drop ADF and work on simpler architectures because ADF is way, way too advanced for you at this time. Instead, spend your time reading books on Java, etc from cover to cover and working through a number of their examples instead.
    Assuming you are an experienced programmer and plan to go ahead with ADF, I suggest you go to amazon.com and order a book on ADF that has good reviews. Read it from cover to cover and work through a number of the book's examples. You should start out with a very very simple ADF project before attempting something more complicated, then build on it. If you are not familiar with some of the components of ADF such as JSF, I suggest you create a few simple projects using them in isolation before combining them all under ADF.

  • How to add jar library in java?

    Hi,
    I am Anil,
    Could it possible to add library in Java library?
    like java.io.DataInputStream is library in Java (JDK), so I want to add my own library in Java JDK.
    I have created a package net.jini.j2space and one interface in it J2Space, I have created jar of this.
    and now I want to this jar to Java library so I can import it in my projects.
    Please help me.
    Thanks in advance.

    Hi, I am Zander Smith and I want to share my story with you. I am a sport star in my community, I am known for my football skills. I had a very healthy physique because I used to do almost 4 hours of daily workout. One day it was raining heavily and I was busy playing football with a nearly club who challenged our team. While playing I hit my leg on the goal post and broke my leg. I came out of hospital after three months. Since I was on complete bed rest I gained 35 pound. I had lost my athletic shape. I was very upset with my bulky body and I wanted to have my old shape back at any cost.
    I started to work out. As I was restricted by doctor to do rigorous work out, it did not help me the way I wanted. After a month one of my friends suggested me [Acai berry|http://ezinearticles.com/?Acai-Berry---How-I-Lost-30-Pounds-in-Under-30-Days-Using-The-Acai-Berry&id=1998407] . I thought that my workouts are enough for losing my weight, but I was impatient. I took all the information about this product and I found it useful. I purchased Acai Berry Supplement and used it. Now it is like a dream come true, I have come back to my earlier shape. Thanks to Acai Berry now I am living my life as I lived before. [Acai berry|http://www.goarticles.com/cgi-bin/showa.cgi?C=1829429]

  • How to run iTunes library off an external pen drive?

    How can we run iTunes library off an external pen drive?
    i have tried everything just doesn't seem to work, just want to free some space up on my Air.

    Let's say the name of the stick is "PenDrive"...
    1. copy the the itunes media folder to the pen drive. The iTunes media folder is the one that contains the sub-folders of Music, mobile Applications etc. let's say your iTunes media folder is called "iTunes Media"
    2. open iTunes. On the menu, click "iTunes", "Preferences...". Click the "Advanced" tab. Change the iTunes library location in the field at the top (I think you can browse for it). When you have it set, it should read "/Volumes/PenDrive/iTunes Media".
    3. The other iTunes files, like the database, should stay on your Macintosh HD.
    4. Once you do this, ALWAYS make sure the pen drive is mounted BEFORE you start iTunes, otherwise it will revert to the media folder on Macintosh HD and you will have to do step 2 again.

  • Can any one suggest me how to tactile this new technology JAVA CARD

    HI
    I AM C.NAVEEN . I KNOW BASICS OF JAVA. AND STUDIED DOCUMENTATION OF JAVA CARD , AND UNDERSTAND THE CONCEPTS REGARDING THAT. BUT HOW TO CHOOSE A CARD AND A CARD READER .
    AS I AM NEW TO THIS TECHNOLOGY . HOW CAN I MOULD MY SELF TO BE A PROGRAMMER FOR JAVA CARDS .....................
    Thanks
    Naveen.C

    Because the Windows 8 is a client operating system.  To make BI4.1 Server work on windows, you'll have to make sure you install it on versions supported as per the PAM below:
    SAP BusinessObjects BI 4.1 Supported Platforms (PAM)
    Please refer page #3 for server operating system, where you will be installing the server software and for all the client tools - refer page #4.
    Make sure you install the server and the client tools as per the supported OS types and versions respectively.

  • How to run system commands from JAVA

    Hi Friends,
    How to run windows system commands from JAVA
    Runtime r=Runtime.getRuntime();
    r.exec("dir");
    Throwing following Exception
    CreateProcess :dir error=2
    Thanks in advance
    Hamsa

    Hi ,
    in Windows NT this is not possible, you can use the following :
    Runtime r=Runtime.getRuntime();
    StringBuffer sbuf = new StringBuffer();
    String dir = new String();
    java.lang.Process proc = r.exec("cmd /c dir");
    InputStream is = proc.getInputStream();
    int ch ;
    while((ch=is.read() ) != -1)
    sbuf.append((char)ch);
    is.close();
    dir = sbuf.toString();
    System.out.println(dir );

Maybe you are looking for

  • How do I convert an entire PAL DVD to NTSC, menus and all?

    Hello everyone, I've been given a set of PAL DVD's which need to be converted into NTSC. Now, from my understanding, there is no one program available that can do this, so I've had to rip all the video tracks off, convert them to NTSC mp2's and autho

  • RE-NAME

    Can a file be renamed without the complicated use of renaming them on the desktop and synching with iTunes?

  • Error whenever error -Script shell error

    Hello this is a pice of my code in my shell script code (bsh) My file name its: ord.extractor_porven2.sh exit | sqlplus -s $USERPV_DB/$PWDPV_DB @$VORDSQLPATH/ord.extractor_porven_V2.sql $VFDESDE $VFHASTA > $VORDDATOS_PATH/ord.extractor_porven2$VDATE.

  • UPDATE statement syntax

    I seem to have the most problem with UPDATE statement syntax. The following select works fine: select * from rco.rpt_ds1_cnt_cat c, rco.rpt_ds1_valid_per_lerg l where l.loc = c.aloc; All I want to do, and preferably with aliases is set c.aloc = l.loc

  • Ios 7 & ipad non-responsive

    I installed the ios 7 on my ipad 2 yesterday.  I got the message to connect to itunes.  I did this and it said I had to restore.  I clicked the button but it failed (several times).  When I plug the ipad into the computer it doesn't appear in my devi