Duke$ - Multiple packages in one jar... again

My jar contains 2 packages.
One is my own, the other one is the JNIRegistry from Ice. (Excellent for Windows. Download it at: http://www.trustice.com/java/jnireg/index.shtml )
My application starts from the jar file and works just fine, but as soon as one of my classes tries to import/load a class from the com-package, the NoClassDefFoundError exception is thrown.
I created the jarfile in my app-folder by using:
jar cfm myJarFile.jar manifest.mf myPackage com
This is the folder tree:
C:\
|
|-app
|
|--com (folder)
|
|--myPackage (folder)
|
|--manifest.mf
I have checked the contents of the jarfile, nothing is missing.
This is the manifest file:
Main-Class: myPackage.App
I am sure there must be a way around this... The closest solution I have found was at:
http://forum.java.sun.com/thread.jsp?forum=22&thread=30891
It says specify each class you want to import from the other package, for example dont use
import com.ice.jni.registry.*;
but
import com.ice.jni.registry.Registry;
import com.ice.jni.registry.RegistryKey;
import com.ice.jni.registry.RegStringValue;
So I did. Nothing changed, still the NoClassDefFoundError
Any help?
Thanks in advance

Hey guys,
This is how you do it. I have an example here for you to follow:
-----Test.java
package com.test;
import another.one.*; // note * is ok to use!
class Test
     public static void main(String[] args)
          System.out.println("Hello from Test!");
          Target.main(null);
}------Target.java
package another.one;
public class Target
     public static void main(String[] args)
          System.out.println("Hello from Target!");
}place files like so:
{path}/com/test/Test.java
{path}/another/one/Target.java
compile classes, then create a manifest:
---manifest.txt
Main-Class: com.test.Test
{a blank line here}
place at:
{path}manifest.txt
now create jar;
{path}> jar cmf manifest.txt myJar.jar com/ another/
and enjoy ;-) java -jar myJar.jar
-Ron

Similar Messages

  • How can I install multiple packages in one time?

    I use Software Update on this PowerBook to download, keep the packages and install onto my 3 Mac's.
    The question is how can I install multiple packages (update stuff) in one time (as we can do with Remote Desktop)? Just to save my time from retarting the machines for every single (required) packages.
    Many thanks, and happy new year.

    320/2766
    Happy New Year Ekapon,
    Instead of downloading the packages in advance,
    check (Software Update default) every software you need, then choose "Install & Keep Package" from the Install menu.
    This will install everything without needing to update prebindings and restart between each installation.
    Axl

  • Loading multiple-package applet from JAR

    Hi, apologies in advance if this has been dealt with in this forum already. I've got two questions:
    Question one: I have written two packages, evolve and fences. I would like to run fences.Fences.class which is an applet. I went to my classpath directory and typed
    jar cf mystuff.jar evolve fences
    (each package lives in its own directory off the classpath.)
    then made a web page that said
    <html><body>
    <applet code=fences.Fences.class archive=mystuff.jar>
    </applet>
    </body></html>
    I then piped the HTML file and mystuff.jar up to a remote server to make sure I wasn't reading my local fences package, made them world readable, and tried to load the web page. On my local machine, a Linux box running Galeon 1.2.5 (Mozilla, basically), I could load the applet. On a separate box running IE 5 I got the error in the status bar "load: class fences.Fences not found" . I'm not sure how to open the Java console in IE so I can't give any more info than that.
    I suspect that perhaps my local box is still somehow using my local classes or an old copy of the applet and is not loading from the archive, but I can't be sure.
    Question two: Until stumbling upon the answer in this forum, I wasn't sure how to run an applet that used more than one user-created package. I see that I can package both into one archive; but I thought that I could also have separate .jar files for each package and then specify both in the "archive=" <applet> parameter. It didn't seem to work. Anybody know if there's a way to do this?
    Thanks in advance for any help!

    yes, i've seen that since i originally posted, tried it - didn't work. I've since tried another even simpler test, to try to isolate the problem. I wrote this code in a file called Tester.java:
    import javax.swing.*;
    class Tester extends JApplet {
      public void init() {
        getContentPane().add(new JButton("Hi"));
    }I compiled this class and put it at http://www.cs.uga.edu/~gundlach/jartry/Tester.class . I then created a webpage in the jartry/ directly that says:
    <html><body>
    <applet code=Tester.class width=55 height=68></applet>
    </body></html>
    Then, using Mozilla to go to http://www.cs.uga.edu/~gundlach/jartry/test.html , I get the applet with the single button. When I open it in IE 5, it says "load class Tester not found" when I mouseover the applet.
    What the heck am I doing wrong?
    Thanks
    Michael

  • How to run multiple packages in one process chain

    Hi,
    we want to run a script logic with badi, followed by a standard move function. The BADI will perform a check and generate an error. If no error occurs, the move can continue ...
    We created our own process chain, which is in fact the combination of a script logic and a move. The data package has underlaying syntax.
    Problem is that the data package does not trigger the process chain ... Nothing happens when running it. When checking the status, nothing gets in here ... We assigned the correct process chain and get message a postivie message when running the package... Is this not possible?
    PROMPT(COPYMOVEINPUT,%SELECTION%,%TOSELECTION%,"Selecteer de gegevens waarvoor een omboeking dient te gebeuren","%CATEGORY_DIM%,%ENTITY_DIM%,PRODUCTIEHUIS,PRODUCTIEWIJZE,NET,KWADRANT")
    INFO(%TEMPNO1%,%INCREASENO%)
    INFO(%ACTNO%,%INCREASENO%)
    INFO(%EQU%,=)
    INFO(%TAB%,;)
    TASK(ZBPC_RUN_LOGIC,TAB,%TAB%)
    TASK(ZBPC_RUN_LOGIC,EQU,%EQU%)
    TASK(ZBPC_RUN_LOGIC,SUSER,%USER%)
    TASK(ZBPC_RUN_LOGIC,SAPPSET,%APPSET%)
    TASK(ZBPC_RUN_LOGIC,SAPP,%APP%)
    TASK(ZBPC_RUN_LOGIC,SELECTION,%SELECTION%)
    TASK(ZBPC_RUN_LOGIC,LOGICFILENAME,STOCK.LGF)
    TASK(/CPMB/CM_CONVERT,OUTPUTNO,%TEMPNO1%)
    TASK(/CPMB/CM_CONVERT,ACT_FILE_NO,%ACTNO%)
    TASK(/CPMB/CM_CONVERT,SAPPSET,%APPSET%)
    TASK(/CPMB/CM_CONVERT,SAPP,%APP%)
    TASK(/CPMB/CM_CONVERT,SELECTION,%SELECTION%)
    TASK(/CPMB/CM_CONVERT,TOSELECTION,%TOSELECTION%)
    TASK(/CPMB/CM_CONVERT,CLEARDATA,0)
    TASK(/CPMB/CLEAR_SOURCE_CUBE,CHECKLCK,1)
    TASK(/CPMB/CLEAR_SOURCE_CUBE,SELECTION,%TOSELECTION%)
    TASK(/CPMB/APPEND_LOAD,INPUTNO,%TEMPNO1%)
    TASK(/CPMB/APPEND_LOAD,ACT_FILE_NO,%ACTNO%)
    TASK(/CPMB/APPEND_LOAD,RUNLOGIC,%RUNLOGIC%)
    TASK(/CPMB/APPEND_LOAD,CHECKLCK,1)
    TASK(/CPMB/APPEND_LOAD,CLEARDATA,0)
    TASK(/CPMB/CLEAR_CUBE,CHECKLCK,1)
    TASK(/CPMB/CLEAR_CUBE,ACT_FILE_NO,%ACTNO%)
    TASK(/CPMB/CLEAR_CUBE,SELECTION,%SELECTION%)

    Hi Sheldon,
    we never have issues when we combine standard objects, like a cliear with a load inforprovider, or the master data integration you mentioned in your document. However, from the moment we combine a script logic with a standard package (like a move) it does not work .The data package contains the task needed for the script and for the move. the process chain is called up but always comes in error in the first step (BPC modify dynamically ) ... there is also no log when checking the view status ...
    I can sent you some screenshots if you like ...
    D

  • Trying to Javadoc multiple packages beneath one directory

    Ok, I have a directory structure like this:
    home/src/data
    home/src/file
    home/src/gui
    home/src/net
    home/src/projects/myProject
    home/src/security
    home/src/utils
    the way it looks on my hard drive would be:
    D:\work\java\home\...
    My "CLASSPATH" is D:\work\java\home
    when I use the Javadoc command from D:\WORK\JAVA :
    C:\j2sdk1.4.1\bin\javadoc -d home/docs -sourcepath /home -subpackages src
    all I get are
    "No source files for package src/data"
    "No source files for package src/gui"
    etc
    THERE ARE .JAVA FILES IN THOSE DIRECTORIES!
    I want to be able to document ALL the packages below
    home/src all together

    I tried the line you provided to me, and I still get the No source files for package data.
    I do have "package src.data;" at the top of my src/data .java files, etc. I understand what you are saying with regards to the -subpackages and the -sourcepath flags.
    My current directory is
    D:\work\java
    my batch file (running from D:\work\java) has the line
    C:\j2sdk1.4.1\bin\javadoc -d home\docs -sourcepath home\src -subpackages data
    and I still get the error. Oddly enough, if I use this set of lines:
    cd home\src
    C:\j2sdk1.4.1\bin\javadoc -d home\docs src.data
    it works fine.
    The only problem with this is my documents are in
    D:\work\java\home\src\home\docs instead of
    D:\work\java\home\docs
    I have "D:\work\java\home" as my CLASSPATH variable in Win2k.

  • [idea] making makepkg able to make multiple packages.

    Hi All!
    I am thinking of creating a modification for makepkg, so that it can build multiple packages from one PKGBUILD. What I mean by this, is that (for example) you write a PKGBUILD for kdemultimedia, and it will build it, but it will spit out a split package.
    An idea of this PKGBUILD is one that I have based around moodin:
    pkgname=moodin
    pkgver=0.4.2
    pkgrel=1
    pkgdesc="Moodin in a ksplash engine which provides funky login screens."
    url="http://moodwrod.com/"
    depends=('kdebase')
    source=(http://moodwrod.com/files/${pkgname}_${pkgver}.tar.gz)
    creates=('moodin_libs' 'moodin_themes')
    build() {
    cd $startdir/src/$pkgname-$pkgver
    #patch -Np1 -i ../???.patch || return 1
    ./configure --prefix=/opt/kde
    make || return 1
    create_moodin_libs {
    cd $startdir/src/$pkgname-$pkgver
    make DESTDIR=$startdir/pkg install
    rm $startdir/pkg/opt/kde/share/themes
    create_moodin_themes {
    cd $startdir/src/$pkgname-$pkgver
    cp themes $startdir/pkg/opt/kde/share/themes -r
    when I makepkg this build script, it will then split out three packages:
    moodin-0.4.2-1.pkg.tar.bz2
    moodin_libs-0.4.2-1.pkg.tar.bz2
    moodin_themes-0.4.2-1.pkg.tar.bz2
    The 'moodin' package, would depend on moodin_libs and moodin_themes.
    makepkg will also do a check on all the packages to make sure that none of the split packages had any conflicting files.
    Please tell me what you think, and if you think it  may be worthwhile.
    Thanks,
    Tim

    JGC wrote:We can have two approaches here:
    - several build functions for several subpackages, meaning pkg/ gets cleaned between calling them
    - one build() function that distributes installed files across several pkg/ dirs.
    JGC, I would rather the second option too, and I think that is more towards I am going to my patch, (read first post above).
    build() {
    CD $startdir/src/$pkgname-$pkgver
    #patch -Np1 -i ../???.patch || return 1
    ./configure --prefix=/opt/kde
    make || return 1
    create_moodin_libs {
    cd $startdir/src/$pkgname-$pkgver
    make DESTDIR=$startdir/pkg install
    rm $startdir/pkg/opt/kde/share/themes
    create_moodin_themes {
    cd $startdir/src/$pkgname-$pkgver
    cp themes $startdir/pkg/opt/kde/share/themes -r
    In this example here, you can see that there is one build function. It is then up to the separate make_'s to do what it has to do to get the package split.
    Hmmm, Well, I am going to start work on it in a few (7 -> 8) hours, so there is still some time to get implimentation ideas
    Thanks,
       - Tim

  • Packaging multiple jars in one jar file.

    Hi I have an application that is packaged into a jar, but I have a library I would like to pack with it, so that my jar-file contains the other jar inside. I thought using Java indexing (jar -i) would work, but it didn't for me.
    Any ideas?
    Thanks.

    I extract 3rd party JARs and then include them in my JAR as follows:
    jar  xf  jakarta-oro-2.0.5.jar
    jar  xf jasperreports-1.2.1.jar
    jar  xf  iReport.jar
    jar cmf  mainClass Spec  Remote.jar  *.class  org/  net/  it/The extraction of jakarta... produces the org/ path, jasperreports... produces the net/ path and iReport ... produces the it/ path. All are in my working directory as are my *.class files. I hope this is the answer you need.

  • I've noticed that in the new version of Firefox that you cannot save multiple tabs at one time like the previous Firefox 3.6.or so and I wanted to know if I can find that feature again?

    I've noticed that in the new version of Firefox that you cannot save multiple tabs at one time like the previous Firefox 3.6.or so and I wanted to know if I can find that feature again?
    In the previous versions of Firefox when you went to you Bookmarks menu it gave you the options to either Bookmark This Page 'command' + 'D', Subscribe to this Page, Bookmark All Tabs 'up-arrow-key' + 'command' + 'D', and Organize Bookmarks 'up-arrow-key' + 'command' + 'B' however in the newest version of Firefox there is no Bookmark All Tabs so you can bookmark all the tabs that you have up in one window at a time. So I need to know if it is possible that the feature is now in a different place, is gone altogether, or if you can get that feature another way?
    For me personally and my work I go through hundreds of web pages a day and save around half of those so it is imperative that I be able to bookmark more then one tab at a time because I can't be bothered to bookmark every single page separately and then go through hundreds of tabs in my Unsorted bookmarks in order to sort those bookmarks. It is simple inconvenient to sort every bookmark individually that is why the previous version of Firefox with the Bookmark All Tabs button was superior in its convenience.

    Right click any tab and choose "Bookmark All Tabs".

  • How to package other jar files into one jar?

    How to package other jar files into one jar? How can i get the class in the inner jar file?

    Generally not a good idea. The Java runtime won't be able to load classes from those "inner" jars, you'd have to write your own classloader to do that. It's not a brilliant idea, generally, anyway, since the point of having lots of jars is to keep your application modular. Bundling them all together like that means you have to re-deploy the whole thing to fix, for instance, one small bug in one small library
    If you really want to do this, there's an Eclipse plugin called FatJar, but I urge you to consider whether you really want to do it first.

  • Versioning using manifest for multiple packages in a single jar

    I am having trouble trying to use the package class to read the version of a specific package from a maifest that contains information about multiple packages. According to Sun specs, you should be able to include information about multiple packages by separating them with a Name. for instance, if my hierarchy is
    com.a.b
    |
    |---com.a.b.c
    and I include in the manifest file,
    Manifest-Version: 1.1
    Name: com/a/b
    Specification-Title: my App package
    Specification-Vendor: someone Inc
    Created-By: someone
    Implementation-Vendor: someone
    Specification-Version: 1.1
    Implementation-Version: build1
    Implementation-Title: com.a.b
    Name: com/a/b/c
    Specification-Title: my App package
    Specification-Vendor: someone Inc
    Created-By: someone
    Implementation-Vendor: someone
    Specification-Version: 1.2
    Implementation-Version: build2
    Implementation-Title: com.a.b.c
    Now if I try to read the specific attributes for package com.a.b.c using Package.getPackage("com.a.b.c").getSpecificationVersion();, I find this to be null. Has anyone had any experience with this?
    thanks

    OK I think finally have it. You have to have the trailing / like you metioned. In addition to that, you need to separate your attributes for individual packages with a newline. SO my manifest should really look like
    Manifest-Version: 1.1
    Name: com/a/b/
    Specification-Title: my App package
    Specification-Vendor: someone Inc
    Created-By: someone
    Implementation-Vendor: someone
    Specification-Version: 1.1
    Implementation-Version: build1
    Implementation-Title: com.a.b
    Name: com/a/b/c/
    Specification-Title: my App package
    Specification-Vendor: someone Inc
    Created-By: someone
    Implementation-Vendor: someone
    Specification-Version: 1.2
    Implementation-Version: build2
    Implementation-Title: com.a.b.c
    Thanks for your help, euxx

  • Need help: how to make a package into a jar file?

    I tried to make a package into a jar file by using:
    jar cf a.jar packagedirectory
    But when I import one class of this package in an other application, by using:
    javac -cp path\a.jar; app.java
    the compliler can not find the calss.
    The interesting thing is if I do not put the package into the jar file, it works well.
    Here is my sample code under path D:\b\b1
    package b1;
    public class Son
         int x = 10;
         public Son(){
         public int getX(){
              return x;
    and the application code under path d:\b
    import b1.Son;
    public class Father
         public Father(){
         public static void main(String[] args)
              Son son = new Son();
              System.out.println("Hello World!"+son.getX());
    Thanks for any advise.
    Xin Cheng

    You must make sure that you are in the right directory
    when you do your jar command to create the archive.
    [home/trejkaz/proj/test/classes]% jar -cf a.jar
    path/to/package/*.class
    Thank you very much.
    Yes, I did as what you said, but it does not work.
    Here is what I did:
    1. Edit Father.java in D:\b
    2. Edit Son.java in D:\b\b1
    3. Compile Son.java
    4. Complie Father.java
    5. Make the a.jar by
    command jar cf a.jar D:\b\b1\ (I cheked the content of the a.jar, it seems right.)
    a.jar is in directory D:\b
    6. Delete Son.class in D:\b\b1
    7. Run Father.class by
    command: java -classpath D:\b\a.jar; Father
    error message is: Exception in thread "main" java.lang.NoClassDefFoundError: b1/Son
    at Father.main(Father.java:11)
    What is the problem?
    Thanks again.

  • Scanning multiple pages in one document

     I am trying to scan multiple pages in one document.  I am using a HP Envy 4501 All-in-one and running Windows 8.1.  I used to be able to do this at one point but for some reason, lately I am not able to.  I have read other posts that spoke of a "+" sign on the left side of the screen, but it is not there for me.  Also, I cannot just save the page and scan the next without having to save them under different file names.  Please advise.
    This question was solved.
    View Solution.

    Hi,
    From the HP Software click on Scan a Document or Photo and ensure the Sow Scan Preview is checked.
    Reduce the Scan Resolution into 300 or a lower resolution and press on Scan, then the add button should appear again.
    Shlomi
    Say thanks by clicking the Kudos thumb up in the post.
    If my post resolve your problem please mark it as an Accepted Solution

  • Setting Up Multiple iPhones On One iTunes Account

    Our business supplies iPhones to our technicians out in the field and I've set each phone up under the same iTunes account.
    Can someone please help me out on the below things that I need to be able to manage?
    I need to be able to back up each iPhone to the work iTunes account on a regular basis, so that I can restore the data if needed. (Windows pc)Is this just a matter of plugging the phones in and setting up as a new iPhone and giving each one a individual name (tech 1, tech 2 etc)? I know it will mean that they'll loose all data and I'll have to set each one up again.
    I would like it if each of the phones can share any apps purchased (music is not used but some productivity apps have and will be purchased)
    I need to ensure that none of the phones share any user sensitive data (messages etc)
    I had a massive issue with all the phones recently - They were duplicating iMessages accross all the technicians phones.
    I've rectified this by disabling iMessages, but is there some way i can allow them to have iMessage without all the phones (which are on the same work iTunes account) duplicating messages or any other user sensitive data?
    Thanks in advance!

    Using More than One iDevice on the Same Computer
    This applies mainly to couples who are adding another device and do not want their email, messages, etc. being duplicated on both devices. To begin read: How to use multiple iPhone, iPad, or iPod devices with one computer. You need to establish a separate Apple ID and password for whomever will use the new iDevice. See Apple - My Apple ID and Frequently asked questions about Apple ID. The easiest way is to do this on the computer using iTunes: iTunes- How to set up an Apple ID within iTunes.
    On the computer create a new user account for the person with the new iDevice. This will be the user account that person will always use. He/She will no longer use the other user account. This way that person will have a separate iTunes Library
    Start by transferring the new device(s) to a new account along with all your data.  Save any photo stream photos that you want to keep to your camera roll (unless they are already in the camera roll) by opening your Photos app, tap on Albums icon at the bottom. Now, tap on My Photo Stream album; tap Select; tap on the photos you want to select;, tap the share icon (box with upward facing arrow) in the lower left corner; then tap Save to Camera Roll.
    If you are syncing notes with iCloud that you want to keep then you need to open each of your notes and email them to yourself. Later you can copy and paste the text into new notes created in your new account.
    Tap on Settings > iCloud > Delete Account (only deletes it from this device, not from iCloud; the person keeping the current account will not be affected,) provide the password to turn off Find My Phone and choose Keep on My iDevice when prompted.  Sign in with a different Apple ID to create your new account. Choose Merge to upload your data.
    Once you are on separate accounts, you can each go to icloud.com and delete the other person's data from your account.
    Note: The essence of the above was created by user, randers. I have made substantial changes to improve readability and syntax.

  • How to implement multiple queues in one circular buffer?

    Spoiler (Highlight to read)
    Recently I have successfully shared data of 2D array among different vis in a project, using circular buffer.
    However, there is only one circular buffer allowed in one project for one data type.
    I want different vis, running and getting data from circular buffer in different speed, all getting data as a queue from circular buffer. Like the circular buffer's read continuous mode.
    The problem is that after a vi reads in continuous mode, the read data is deleted from the circular buffer. Then other vis can not use them any more and can not keep track where they should begin to read again.
    So if it is possible that there are multiple pointers or queues in circular buffer to keep track the progress of different vis, and data only update when it gets input from DAQ but not deleted when read?   

    LawrenceChong wrote:
    Spoiler (Highlight to read)
    Recently I have successfully shared data of 2D array among different vis in a project, using circular buffer.
    However, there is only one circular buffer allowed in one project for one data type.
    I want different vis, running and getting data from circular buffer in different speed, all getting data as a queue from circular buffer. Like the circular buffer's read continuous mode.
    The problem is that after a vi reads in continuous mode, the read data is deleted from the circular buffer. Then other vis can not use them any more and can not keep track where they should begin to read again.
    So if it is possible that there are multiple pointers or queues in circular buffer to keep track the progress of different vis, and data only update when it gets input from DAQ but not deleted when read?   
    THe last time I wrote a multi-subscriber cirular buffer was in LV 6. Since then I have found that polymorphic queues perform much better so I now use multiple queues. One queue for each subscriber of the data. The subscribers are then responsible for maintaining their own histories.
    So just use multiple queues.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • I have 3 i phones.  Can I have multiple accounts on one computer where it keeps the contacta and calendar for each?

    I have 3 i phones.  Can I have multiple accounts on one computer where it keeps the contacta and calendar for each?

    My daughter and I both have iphones. I created an account (not separate itunes) for her on my computer so she could sync her phone/itunes but not have it interfere with mine since we have WAY different taste in music. Creating a different computer profile should work if you have separate itunes accounts, too.
    If you all use the same itunes account, you can turn on Home Sharing. That way you can all download the same content without having to pay for it again. Not sure how or if that works with separate itunes accounts.
    Hope that helps!

Maybe you are looking for

  • Cube to cube data transferred ,and delta status

    Hi Gurus I need to do Portioning in cube I have a cube Zaa_c01 which is updated by two data source ZDS1 and ZDS2 (Delta Update) I copy the Zaa_c01 and I created new cube Zaa_c02, also I transferred the data to that. But it is shoeing in single reques

  • Error while invoking "create" on odata model

    Hello, I have an OData model  (added to the view) to which I would like to add a new entry: var data = { ID : 1234, SCENARIO_INSTANCE_ID : "235800598404399104", FULL_NAME : "Joachim", EMAIL : "[email protected]", TELEPHONE : "+555 11 222", CELLPHONE

  • External break point in sap r/3 system

    i want to set external debugging to rfc in r/3 i tried to set it its getting set but when i call rfc from external system(webdynpro) its not gng to that break point i.e its not linking to that break point what could be the reason and how we can set e

  • N73 / PC suite / communication center / import con...

    Hi, I downloaded my contacts from my N73 in CSV format. I edited the CSV. Now when I try to import this file via pc suite/ communication center the program crashes ("communication center stopped working, windows vista is trying to find a solution bla

  • HT4623 The new update of ios 7  massage didn't come till now and i don't know what to do??

         The new update of ios 7  massage didn't come till now and i don't know what to do??