Java package question

This is a follow-up to the following topic: Code sharing between applets
If I organize my source code in Eclipse with JCOP plugin the following way:
package A;
package A.B;
Where package A contain common code, and package A.B contain the applet code - is there a way to combine these two packages into one CAP file? Currently, my toolchain produce two CAP files (one for package A and one for package A.B), and I have to upload both into the card. I'm really looking for a way to structure the source code this way, but still be able to produce just one CAP file containing code from both package A and A.B.

HI, One package will always be generated into one cap, so you can not generate two package into one CAP file

Similar Messages

  • Problem finding native methods in java packages

    I have a java class which uses some native methods written in OCamL. I wrote a C file which calls the OCamL code, and created the corresponding shared library using the jni. I then tested my java file and everything works fine, I can nicely call the OCamL functions. However, I need this java file to be included in a package, but whenever I add the line:
    package somepackage;
    on top of the java code, my java file simply doesn't seem to find the C and OCamL implementation anymore :
    javac -cp :./path/of/somepackage
    -Djava.library.path=/full/path/of/somepackage MyProgram args
    Exception in thread "main" java.lang.UnsatisfiedLinkError:functionName
    at somepackage.ClassName.functionName(NativeMethod)
    I have of course put everything (java, C, .h ,, and OCamL files) in a directory called somepackage, and written another java file which creates an instance of the first one from outside the package, imports the package, and calls its methods in main(). It just doesn't work anymore.
    I then added a simple hello-world function (not C nor OCamL code) to the java file inside the package. And when invoked from outside, it worked. Question is then... Am I forgetting something to be done, in order to get C and CamL files efectively included in the java package (same as "package somepackage;" in C or OCaml, perhaps)??? Why isn't the java file able to find them inside its very own directory (having into account that without the package definition it worked well)?
    PS Im using jsdk 1.4.1 on lunyx redhat 8.0

    Did you change the name of the function in the library, too?
    If the function name was
    it should be now

  • Java package - money

    good evening guys,
    i am finding a piece of work extremely tough going at the moment and wondered if i could get any hints/help on where im going wrong. i am aiming to produce a package ( which could be used in order to produce arithmetic calculations on sums of money.
    The code i have at the moment is:
    package java;
    public class money
         private int data1, data2;
         public money()
         public money(int value1, int value 2)
              data1 = value1;
              data2 = value2;
        public void addMoney(int value1, int value2)
              return value1 + value2;
         public void subtractMoney(int value1, int value2)
              return value1 - value2;
         public void divideMoney(int value1, int value2)
              return value1 / value2;
         public void multiplyMoney(int value1, int value2)
              return value1 * value2;
    public class MoneyTest
        public static void main(String [] args)
             money p = new money(10,20);
             System.out.println("The total is " + p.addMoney());
    }I think i may need a 'toString' method? and also, is there any way of covering errors? im sorry if these problems are trivial. I have various books, but can't seem to use them in this case.
    Thank you for any feedback.

    That's a class, not a pakcage.
    Do you need a toString? There's already a toString defined on Object that you inherit. It's not very useful though. If you want to show something more meaningful when you do, say, System.out.println(aMoneyObject); then yes, you'll need to override toString.
    What are data1 and data2? Those are meaningless names and you never use them.
    As for handling errors,
    It's not clear what you're trying to accomplish, and your questions are rather vague, so it's difficult to provide useful advice.

  • Import Java package in JSP

    I hope this is an appropriate forum for this query.
    I want to be able to access a user-created Java package in JSP.
    I have this code:
    <%@page import="TPClass.*" %>
    xxx = TPClass
    The error display points to TPClass in the import statement with the message "TPClass not found".
    TPClass files are in the same location as the other project files.
    I have creatyed and compiled the TPClass package.
    Is there more I need to do?

    I think you are very new to java....
    <%@page import="class name with full qualified package name"%>
    <%@page import="com.x1.x2.TPClass"%>
    TPClass cls =new TPClass();
    //then do whatever you want...
    hope u understand now.....


    i Have two problems one is i am designing a website which consists of a form. I am trying to write the Connectiviy and all other insert statements in seperate java packages and include them in JSP files.
    i Have two java packages one is DBUtil(having two java files both dealing with connectovity) and another one is StudentUtIl which has java files that open the connections with database connection and insert data into DB., I am having a big Problem here. How can i call the function in the other java package in the files in this java package. i have openDB()and Close() in the other Db and i want to call these functions in JAVA classes in the other package. How to include a package. Both these packages are in the same File system mounted on a Local directory

    Thank you for the reply. I am giving the code i have given the full class name . and now it is giving the following error :
    Cannot reference a non-static method connectDB() in a static context.
    I am also giving the code. Please do help me on this. i am a beginner in java.
    import java.sql.*;
    import java.util.*;
    import DButil.*;
    public class StudentManager {
    /** Creates a new instance of StudentManager */
    public StudentManager() {
    Connection conn = null;
    Statement cs = null;
    public Vector getStudent(){
    String Query = "Select St_Record, St_L_Name, St_F_Name, St_Major, St_Email_Address, St_SSN, Date, St_Company, St_Designation";
    cs = conn.createStatement();
    java.sql.ResultSet rs = cs.executeQuery(Query);
    Vector Studentvector = new Vector();
    Studentinfo Student = new Studentinfo();
    if( cs != null)
    if( conn != null && !conn.isClosed())
    return Studentvector;
    }catch(Exception ignore){
    return null;
    }finally {
    import java.sql.*;
    import java.util.*;
    public class dbutil {
    /** Creates a new instance of dbutil */
    public dbutil() {
    Connection conn;
    public void connectDB(){
    conn = ConnectionManager.getConnection();
    public void closeDB(){
    if(conn != null && !conn.isClosed())
    }catch(Exception excep){
    The main error is occuring at the following lines connectDB() and closeDB() in the class student manager. The class dbutil is in an another package.with an another file called connectionManager which establishes the connection with DB. The dbutil has the openconnection and close connection methods. I have not yet written the insert statements in StudentManager. PLease do Help me

  • NoClassDefFound error when using custom Java package in scripting QPAC

    I compiled a little Java-package (.jar), which contains a class that uses
    I put my library in the lib folder of JBoss (...\server\all\lib).
    Then I'm was trying to invoke my custom class in the scripting QPAC. But I'm constantly getting the error message
    NoClassDefFound com\adobe\workflow\datatype\form\FormDataTypeInstanceImpl. I already put
    adobe-wkf.jar (and various others) in the lib folder of JBoss. Without ever succeeding. Unfortunately.
    I'm going mad about this.
    Is there a way to address a custom package in the scripting QPAC, which uses

    Removing the LiceCycle jars from the lib folder did not work. I still get the same error message.
    What I wanted to do is provide some basic utilities, without having to spend a lot of time designing QPAC user interfaces.
    My utility class contains methods like this one:
    public static 
    org.w3c.dom.Document formToXml
    FormDataTypeInstanceImpl pFormData
    ParserConfigurationException, SAXException, IOException 
    data = pFormData.getXFAData
    InputStream objXMLInputStream = 
    // create new Document object
    DocumentBuilderFactory objFactory = DocumentBuilderFactory.newInstance
    DocumentBuilder objBuilder = objFactory.newDocumentBuilder
    org.w3c.dom.Document objDocument = objBuilder.parse
    Even without ever invoking the aforementioned method, I get the error
    NoClassDefFound: FormDataTypeInstanceImpl. Which is pretty weird.
    Do I have to write my own classloader?

  • How to find classes in a java package

    i am writing a java IDE. i want to extract all class names from a java package eg. java.lang (through coding). how can i do that.
    Thanks in advance

    File file = new File("path to your jar file");
    JarFile jf = new JarFile(file);
    Enumeration e = jf.entries();
    ZipEntry ze = null;
    ze = (ZipEntry) e.nextElement();
    ze.toString(); // gives you the file name
    you have to understand java.util.jar packages for working with jar/zip files.
    Hope this helps

  • How to import java package in form 10g

    i have make a java package but its not looking so far possible to include it in java import list, how i can import it in form 10 g

    if classpath does not work you can try to add your jar file at this registry key :

  • Problem with Java-Packages in JavaFX-Scripts

    What I'm trying to do is using a class I've built in my project in a JavaFX-Script, my problem is that the compiler keeps telling me my package wouldn't exist.
    My filestructure is basically the following:
    |-- MyFXScript.fx
    I've tried importing the package or just writing the fully qualified classname when trying to create an instance, the messages didn't differ. I'm not at home right now so I don't remember the exact compiler-message, but it was something like "Package does not exist:".
    Any ideas? :-)
    Kind regards,
    Edited by: gnrx on Jan 12, 2009 5:55 AM

    It works on my system.
    public class MyClass {
        public String toString() {
            return "My Class";
    var myClass = new MyClass();
    My Class
    BUILD SUCCESSFUL (total time: 3 seconds)

  • Java packages and dependency

    When java was being developed, what was the philosophy behind allowing packages to be mutually dependent?

    Hello Steve,
    The Acyclic Dependencies Principle tells us that no cycles should exit in a model depicting the dependencies between packages. From what I can gather this is useful when developing large software systems, as each package becomes a viable work unit for an engineer or small group of engineers to control as a series of releases. If the ADP is not complied with, cycles may exist in the dependencies between packages. If a change is made to one of those packages within a cycle, then an ugly situation develops as the repercussions of the change are looped through the cycle back to its source and so on.
    The thing is though, during my readings I came across a statement that said Java packages were mutually dependent. I was just wanting to know why a language that utilises object oriented technology, left the practice of the ADP up to the descretion of the developer? Is the full implementation of ADP on a software system an ideal world scenario?

  • Java package and c++ header files

    What is the difference between importing java package and including header files in c++?

    I do not know .. have been away from C/C++ for a long time...
    As much as I remember you can only import one header file each time... also when you import a header file you can just call methods from the header file automatically ...
    However I could be very wrong on this .. really lost touch from C/C++ ...

  • Error occured while running .java package in BPEL

    Hi All,
    I'm trying to run .java package which is using RIDC components (GET_FILE) option.
    I have set my local IP address in the config.cfg file also and restarted.
    Still i'm getting below error in Jdeveloper when I run the package.....
    oracle.stellent.ridc.protocol.ProtocolException: Unable to initialize connection idc://tgreenspence:4444
    *     at oracle.stellent.ridc.protocol.intradoc.socket.SocketConnectionManager.initializeConnection(*
    *     at oracle.stellent.ridc.protocol.intradoc.socket.SocketConnectionManager.initializeConnection(*
    *     at oracle.stellent.ridc.protocol.impl.SimpleConnectionPool.acquireConnection(*
    *     at oracle.stellent.ridc.IdcClient.sendRequest(*
    *     at test.TestRIDC.TestRIDCGetFile.main(*
    Caused by: oracle.stellent.ridc.protocol.ProtocolException: Connection timed out: connect
    *     at oracle.stellent.ridc.protocol.intradoc.socket.SocketConnection.connect(*
    *     at oracle.stellent.ridc.protocol.intradoc.socket.SocketConnectionManager.initializeConnection(*
    *     ... 4 more*
    Caused by: Connection timed out: connect
    *     at Method)*
    *     at*
    *     at*
    *     at*
    *     at*
    *     at*
    *     at<init>(*
    *     at<init>(*
    *     at oracle.stellent.ridc.protocol.intradoc.socket.SocketConnection.createSocket(*
    *     at oracle.stellent.ridc.protocol.intradoc.socket.SocketConnection.connect(*
    *     ... 5 more*
    What will be the solution ??

    take the code out of bpel. run it standalone. does it work?

  • Just Starting out with java packages

    I'm a beginner and I'm starting out with java packages.
    I wrote two simple .java files, one test program and one containing a simple class.
    Both files are compiling without errors but When I run the program I get an error NoClassDeffoundError.
    I use the import <package> statement And I think I'm using the CLASSPATH variable correctly.
    SET CLASSPATH=d:\nopol
    path for the .java containing the test class is:
    d:\nopol\utilities \myapp.
    In the test file I use "import utilities.myapp.*.
    I would be very happy if anyone could help me
    Thanks beforehand

    The test file should be in d:\nopol, if it's not a part of your package utilities.myapp. Everything should be compiled from d:\nopol, the test class with "javac" and the class in the package with "javac utilities/myapp/".
    Your classpath seems fine for now, though. But yes, do add the period there, otherwise you could run into problems later.

  • Use of Java packages in Java stored procedures? (Oracle 10.2)

    Hi all-
    Does Oracle's Java stored procedures support Java packages? In all the examples I've seen, packages are never used, and when I added one to a test file, it compiled it just fine, but referencing the class from the package itself resulted in a compiling error.
    In other words, it seems to make absolutely no difference if I preface my Java class with
    package com.mycompany.whatever;
    and while I can "import com.mycompany.whatever.MyClass" in another Java file, it seems to not care at all whether I do so or not.
    Thanks for any clarification,

    Hi Ilford:
    Sure you can use fully package notation in your Java classes.
    Look at this Java source code:
    All of them are Java Stored procedures.
    Best regards, Marcelo.

  • Java package to parse email

    I was wondering if anyone knows of a java package which does the following. Monitors an email account (could be through SMTP) and downloads email based on certain rules you can mention in the config file. For instance, if the the email comes from address [email protected] then download the attachment B.pdf to a certain folder.

    harsh884 wrote:
    May be you can use Apache common-logging.jar its API for getting logs....try the link below
    Was that meant to be posted in this thread?

Maybe you are looking for

  • Identiying in which table a field belongs to

    we have requirement to bring value of field NBW- BOOK VALUE AT FISCIAL YEAR END, WHICH is defined in a structure. now how to know in which table the value of this field is stored. thanks

  • Answers export to CSV in other charsets as Unicode possible?

    Hello, is it possible to set the character set to anything other than Unicode when the user exports data from an Answers report to a CSV file? I searched through the documentation, but could not find anything useful, except for a setting in NQSServer


    i want to buy/purchase official DVD's of the   1: WINDOWS 8.1 ENTERPRISE LICENSES FOR OLP 2: SERVER 2012 R2 LICENSES OLP (for charity hospital) my location is Pakistan can any one guide me the official way and process. 

  • Delete row number

    i have a report generated by a selector. if my record has many rows i can change page and see the oder raws , but if i'm not in the first page, and i use a selector, the report don't show the new can i do???

  • Laserjet 400 can't print envelopes ...

    All- We purchesed a LaserJet 400 Color (M451) nw printer last year, and printing regular documents works fine. However, we have a lot of problems printing "non-letter" documents such envelopes, 3x5 cards, and other items. We are not trying to load di