Automatically includng dependecies in jar files

We are using JBuilder 6 on our project. The archive builder wizard has the ability to automatically determine the dependencies of the classes you select and include them in the jar. This I like. The problem is we want to be able to source control the content list or 'plan' for building the jar so that we can distibute it to other members of the team. There doesn't seem to be a way to save this info in JBuilder. Is there are tool that has similar features that uses a batch file or something else that we can save?

To make a .bat file:
1. open a text editor and a new (blank) document
2. put your command line arguments for creating your
Jar into the document. You should be able to either
copy this from JBuilder, or just inspect the jar file
and see what you need to include
ex. (In your file) jar -myJar.jar *.class
3 Save the file with the extension .batThanks for trying to help but I know how to create a batch file and I know hoe to create a jar file using the jar tool.
What I want is tha ability to pick out the classes I 'really' need and have a tool that determines the dependencies. We have a group of people working on the same code base. If a class' dependencies change most of the developers will never know. If we did what you are suggesting, we would spend more time maintaining the batch file than it takes to set up the archive in JBuilder with much less reliability.
For example. We have a session bean coded in JBuilder and we want to load the classes into our server (we didn't spring for the enterprise edition.) In JBuilder we can create an archive, select the remote home and bean classes, tell it to include all dependencies and it will create the jar with all the classes we need to deploy the session bean. This is an easy one. The problem is that I can't take my 'plan' i.e. the three classes in the content pane of the wizard and import them into my co-workers JBuilder environment. He or she must create the archive from scatch. This isn't a big deal as long as everyone follows naming conventions and the number of classes that are 'needed' is small but we have some cases where we need to specify a dozen or more classes in the content pane.

Similar Messages

  • URGENT: New JAR file NOT being pushed to web clients.

    Greetings...
    When our web app first came to market, some of our customers were still using a dial-up connection. Therefore, since one of our web pages uses an applet, it was decided to ship the necessary JAR files to clients on an installation CD, rather than burden our dialup customer with having the JAR files pushed out to them over the line. The jar files are installed in the C:\Program Files\JavaSoft\JRE\1.3\lib\ext directory on the client computers.
    Don't ask why, but we are now attempting to have our web site push out a new JAR file to just one of our clients, but the problem I'm running into is that if the OLD jar file already exists in the C:\Program Files\JavaSoft\JRE\1.3\lib\ext directory, the NEW jar file isn't pushed out by the website. My understanding was that the system would automatically detect if the JAR file on the client was older than the JAR file on the server and would then push the newer JAR file out to the client, but obviously, I'm missing something.
    Any help/suggestions you can provide would be greatly appreciated. Following is the kludgy ASP code for this...
    <%szCustomer = getCustomer();%>
    <%if (szCustomer="SccTest") {%>
    <!-- NEW CODE: Push out the NEW JAR file with the meters to feet change. -->
    <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="600" height="400" name="SccMapplet"
    codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0" ID="IMSMap" VIEWASTEXT>
    <PARAM NAME="code" VALUE="com.scc.mapplet.SccMapplet">
    <param name="archive" value="SccMapplet.jar,xml.jar,iiimp.jar,jai_codec.jar,jai_core.jar,mlibwrapper_jai.jar">
    <PARAM NAME="scriptable" VALUE="true">
    <PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
    <PARAM NAME="WebAXL" VALUE="/EweData/<%=getCustomer()%>.axl">
    <PARAM NAME="Session" VALUE="<%=SCCSession.SessionID%>">
    <COMMENT>
    <EMBED type="application/x-java-applet;version=1.3" width="600" height="400"
    code="com.scc.mapplet.SccMapplet" archive="SccMapplet.jar,xml.jar,iiimp.jar,jai_codec.jar,jai_core.jar,mlibwrapper_jai.jar"
    pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html">
    <NOEMBED>
    </COMMENT>
    No Java 2 SDK, Standard Edition v 1.3 support for APPLET!!
    </NOEMBED></EMBED>
    </OBJECT>
    <%} else {%>
    <!-- OLD CODE: Use the JAR file already installed on C:\Program Files\JavaSoft\JRE\1.3\lib\ext -->
    <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    width=600 height=400 ID="IMSMap" name="SccMapplet" VIEWASTEXT>
    <param NAME="code" VALUE="com/scc/mapplet/SccMapplet">
    <param NAME="name" VALUE="IMSMap">
    <param NAME="SCRIPTABLE" VALUE="TRUE">
    <param NAME="type" VALUE="application/x-java-applet;version=1.2">
    <PARAM NAME="WebAXL" VALUE="/EweData/<%=getCustomer()%>.axl">
    <PARAM NAME="Session" VALUE="<%=SCCSession.SessionID%>">
    <comment>
    <embed type="application/x-java-applet;version=1.2" width="600" height="480" code="com/esri/ae/applet/IMSMap" name="IMSMap">
    <noembed>
    </COMMENT>
    No JDK 1.2 support for APPLET!!
    </noembed></embed>
    </object>
    <%}%>

    I guess the problem is, that your local jar file's classes copied to the JRE's ext directory have higher priority. The JRE does not store your applet jar locally and so does not overwrite anything you may have installed, it only executes the jar file given by the browser which may cache it or not.
    Why don't you use the Java Webstart technolgy? It's pretty simple to use it. Customers would have to download every new jar version only once and Webstart will take care that the local version is up-to-date every time your app is started.

  • Load .JAR file using SQL Developer

    Hi,
    I have couple of .JAR files on my local machine which has to be loaded on to the oracle server (11g). I tried using the load Java functionality in the SQL Developer but realised one could load a java class only if you had the source code.
    Is my understanding correct or is there a way to load a JAR file using sql developer ?
    Thanks

    K,
    Thanks for the answer.
    Do you know if you have to restart oracle after loading .jar files ? I ask this because I am not aware if oracle/jvm automatically knows that the jar files have been uploaded.
    Thanks

  • Automatical jar file structure in SunOne studio (forte)?

    Hi everyone!
    I wonder if anyone knows how to jar a folder structure in SunOne (former forte). I have a "myRoot" folder which I would like jar to "myRoot.jar". But I also want the subfolders to be jar:ed. I.e. I have myRoot/test/ and I want to jar them so that I may reach "test" this way: "myRoot.test" .
    I know how to create a jar from one folder, but do the subfolders hang on automatically or do I have to specify them as well?
    best regards,
    Linda Eric

    I don't know about SunOne specifically but, in general, jar does it's work on subdirectories, too. So, if you ran the command line version of jar, you might do something like this:
    jar -cvf myRoot.jar ./myRoot
    Which would jar up the whole myRoot tree. You can verify what's in the jar file by running the following:
    jar -tf myRoot.jar
    Which lists everything in the archive. Hope that helps -
    Sam

  • Update automatically a JAR file

    He folks!
    Here is what i want to:
    1.
    Develop a little dummy java applet (just for testing), placed in a jar file.
    2.
    That applet should be signed as a trusted applet, so that it can do some more
    stuff on the client and
    3.
    Every time the user starts the applet on his client, the applet should
    check on the server, if there is a newer version, and if so
    update itself automatically, if not just start the jar file on the client machine.
    Does anyone have any suggestions how to do that, or where to get some informations
    about that topic?
    greetings
    Normen

    Every time the user starts the applet on his client,
    the applet should
    check on the server, if there is a newer version, and
    if so
    update itself automatically, if not just start the jar
    file on the client machine.That is already done automatically. If you want to bind the caching to a certain version number, or understand more about applet caching, you should read this single page: http://java.sun.com/j2se/1.4.1/docs/guide/plugin/developer_guide/applet_caching.html

  • Automatic launch of .jar files

    how to configure Java to automatically launch .jar files on double click in Windows and single click in Linux

    Windows should be set up to run jar files when you install a JRE or JDK. I don't know about Linux. If it doesn't happen automatically, you must tell the OS that when you click a jar file, it should launch the jvm with the parameter "-jar [filename]".
    To make your jar files executable, include a parameter called "Main-Class" in the manifest file, containing the name of the main class of your application. So if your main class (the one with the main-method) is called mypackage.myapplication.MyMain.class, the manifest file should have the entry    Main-Class : mypackage.myapplication.MyMain

  • How can a jar file is download and used on client automatically from server

    i am using JAI.jar(sun jar file),tiffimage.jar(my jar file) and some fonts(Hindi) on the client side in my project.can we download and use the above files from the server on the client side automatically without the client installation.
    please reply me as soon as possible

    you can use Java Web Start to load all the jar files. JDK 1.4.1 is come with Java web Start.

  • How can I create a jar file that will run automatically on double click

    all the jars I created run only from the command-line.
    how can I make it run by double-click on it?

    First you will need to associate .jar files with the javaw.exe program in order to just be able to double click on the jar and run it from within a windows explorer application. Next you will need to set the main class attribute of the manifest file. My understanding is that the value of this attribute is used by the launcher to know which class to load. In other words, which is your main application class. To specify this attribute open your manifest file in a text editor. You will find this file located within the jar at META-INF/MANIFEST.MF. Then, add the line,
    "Main-Class:<relative path to the main class>" However, remember not to add the .class extension to the end of the class name.
    In Windows 2000 you can associate jar files with javaw by finding a jar file in Windows Explorer and right clicking it. This will give you a context menu which should have an Open With... option (if you are not using Windows 2000 and don't see the 'open with' menu item, try holding down the shift button while right click on the file). Select the Open With... option, then, when the dialog appears highlight javaw and select the "Always use this program to open these files" checkbox. When you hit the OK button you should have all your jar files associated with the javaw process.
    Once you've done this, you should be able to double click on your jar file and run your application.
    Regards,
    Daniel Walsh

  • How to compile jar file including all dependencies ?

    Hi all,
    I have an application with more than 50 classes that use third party libraries.
    I would like to compact everything in just one single jar file BUT just the classes I need, not the whole external libraries.
    Archive builder from JBuilder works pretty fine, but I need a command line tool to integrate this into an automatic compilation process from a bigger project.
    What can I use ?
    Thanks a lot!

    Yes, I can live with it but, I cannot
    believe
    that there is no any command line tool for doingwhat
    Archive Builder from Borland does !!I'd bet a year's salary that Archive Builder isn't
    foolproof anyway. When you consider classes may be
    instantiated dynamically thru reflection and so
    forth, there's no way any tool can really tell with
    100% certainty what all the dependencies are.But apart from dynamic class loading? I can manage dynamical loaded classes manually, but would be really helpful to have an automatic tool for including all 'static' dependecies.
    This is a common task in other programming languages. How to do this using standard (free?) java tools?

  • Unable to access jar file error !

    hello,
    i have built my netbeans project and obtained the hequalifies.jar file . unfortunately when i'm trying to run this jar file from the prompt command I'mgetting the error: unable to access jar file
    here is the command i'm typing:
    C:\Users\User\Documents\NetBeansProjects\hEqUALIFIES\dist>java -jar " C:\Users\U
    ser\Documents\NetBeansProjects\hEqUALIFIES\dist hequalifies.jar "
    anyone has any clue?
    10x!

    ok i'm gonna make it easier on you.
    i gess i found what is the problem but have no idea how to solve it.
    when i obtained the .jar file i also obtained a README.txt file in which it is written the following phrase:
    ** If a library on the projects classpath also has a Class-Path element*
    specified in the manifest,the content of the Class-Path element has to be on the projects runtime path.
    I'M SORRY BUT I DID NOT UNDERSTAND WHAT IS MEANT BY: what is "the projects runtime path"?
    the content of my manifest is:
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.7.1
    Created-By: 10.0-b23 (Sun Microsystems Inc.)
    Main-Class: hequalifies.ui.HeQualifies
    Class-Path: lib/PlugIn
    X-COMMENT: Main-Class will be added automatically by build
    I'm having problem with lib/plugin.

  • Runtime.exe() is not working from within a jar file.

    Hi All,
    I have a jar file which have classes and a package in it.
    One of these classes is calling another class which is present in the package.
    The code i am using it is as follows:
    Runtime r=Runtime.getRuntime();
    Process p=null;
    p=r.exec("java deep.slideshow.PlayShow");It is working fine when i am executing it without making jar file.
    But when i make a jar file of all these things , this exec() is not working.
    I have tried a lot.
    If any body has any idea suggest me.
    Thanks

    thanks a lot for your reply friend.
    I tried the same you tell me to do by using the cmd;
    java -cp my.jar package.class  And then tried to make the jar file with the help of eclipse,
    after adding my jar file into classpath of my project in eclipse.
    Its working fine on my local system.
    But when i put this jar file on some other system it does not call my jar file(obviously bcz it will not the find the jar file according to the classpath set on my local system. )
    Is there any way that i can keep this jar into my project and then can give the classpath dynamically
    so that it can pick the file from my project automatically.?
    Later on i will pack this whole thing into a full jar file and it will work on a single click.
    Is it possible or not ?
    Please suggest me.
    Thanks

  • Adding JAR file to project

    Hi All
    How can i add jar to my project environment.
    Actually what i did was.
    Created one folder called "JavaWork" like d:\JavaWork
    and put the jar file into this folder and wrote a test class which is importing some classes from the jar file.
    how to use jar ? Please someone help me.
    Thanks in advance
    Shan

    `man jar`
    jar(1) jar(1)
    NAME
    jar - Java archive tool
    SYNOPSIS
    jar [ -C ] [ c ] [ f ] [ i ] [ M ] [ m ] [ O ] [ t ] [ u ]
    [ v ]
    [ x file ] [ manifest-file ] destination input-file
    [ input-files ]
    DESCRIPTION
    The jar tool is a Java application that combines multiple
    files into a single JAR archive file. It is also a gen-
    eral-purpose archiving and compression tool, based on ZIP
    and the ZLIB compression format. However, jar was
    designed mainly to facilitate the packaging of Java
    applets or applications into a single archive. When the
    components of an applet or application (.class files,
    images and sounds) are combined into a single archive,
    they can be downloaded by a Java agent (like a browser) in
    a single HTTP transaction, rather than require a new con-
    nection for each piece. This dramatically improves down-
    load time. The jar tool also compresses files, which fur-
    ther improves download time. In addition, it allows indi-
    vidual entries in a file to be signed by the applet author
    so that their origins can be authenticated. The syntax
    for the jar tool is almost identical to the syntax for the
    tar(1) command. A jar archive can be used as a class path
    entry, whether or not it is compressed.
    The three types of input files for the jar tool are:
    o Manifest file (optional)
    o Destination jar file
    o Files to be archived
    Typical usage is:
    example% jar cf myjarfile *.class
    In this example, all the class files in the current direc-
    tory are placed in the file named myjarfile. A manifest
    file is automatically generated by the jar tool and is
    always the first entry in the jar file. By default, it is
    named META-INF/MANIFEST.MF. The manifest file is the
    place where any meta-information about the archive is
    stored. Refer to the Manifest Format in the SEE ALSO sec-
    tion for details about how meta-information is stored in
    the manifest file.
    To use a pre-existing manifest file to create a new jar
    archive, specify the old manifest file with the m option:
    example% jar cmf myManifestFile myJarFile *.class
    When you specify cfm instead of cmf (that is, you invert
    the order of the m and f options), you need to specify the
    name of the jar archive first, followed by the name of the
    manifest file:
    example% jar cfm myJarFile myManifestFile *.class
    The manifest uses RFC822 ASCII format, so it is easy to
    view and process manifest-file contents.
    OPTIONS
    The following options are supported:
    -C Changes directories during execution of the jar com-
    mand. For example:
    example% jar uf foo.jar -C classes *
    c Creates a new or empty archive on the standard out-
    put.
    f The second argument specifies a jar file to process.
    In the case of creation, this refers to the name of
    the jar file to be created (instead of on stdout).
    For table or xtract, the second argument identifies
    the jar file to be listed or extracted.
    i Generates index information for the specified jar
    file and its dependent jar files. For example,
    example% jar i foo.jar
    would generate an INDEX.LIST file in foo.jar which con-
    tains location information for each package in foo.jar and
    all the jar files specified in foo.jar's Class-Path
    attribute.
    M Does not create a manifest file for the entries.
    m Includes manifest information from specified pre-
    existing manifest file. Example use:
    example% jar cmf myManifestFile myJarFile *.class
    You can add special-purpose name-value attribute
    headers to the manifest file that are not contained
    in the default manifest. Examples of such headers
    are those for vendor information, version informa-
    tion, package sealing, and headers to make JAR-bun-
    dled applications executable. See the JAR Files
    trail in the Java Tutorial and the JRE Notes for
    Developers web page for examples of using the m
    option.
    O Stores only, without using ZIP compression.
    t Lists the table of contents from standard output.
    u Updates an existing JAR file by adding files or
    changing the manifest. For example:
    example% jar uf foo.jar foo.class
    adds the file foo.class to the existing JAR file
    foo.jar, and
    example% jar umf foo.jar
    updates foo.jar's manifest with the information in
    manifest.
    v Generates verbose output on stderr.
    x file
    Extracts all files, or just the named files, from
    standard input. If file is omitted, then all files
    are extracted; otherwise, only the specified file or
    files are extracted.
    If any of the files is a directory, then that direc-
    tory is processed recursively.
    EXAMPLES
    To add all of the files in a particular directory to an
    archive:
    example% ls
    0.au 3.au 6.au 9.au at_work.gif
    1.au 4.au 7.au Animator.class monkey.jpg
    e.au 5.au 8.au Wave.class spacemusic.au
    example% jar cvf bundle.jar *
    adding: 0.au
    adding: 1.au
    adding: 2.au
    adding: 3.au
    adding: 4.au
    adding: 5.au
    adding: 6.au
    adding: 7.au
    adding: 8.au
    adding: 9.au
    adding: Animator.class
    adding: Wave.class
    adding: at_work.gif
    adding: monkey.jpg
    adding: spacemusic.au
    example%
    If you already have subdirectories for images, audio
    files, and classes that already exist in an HTML direc-
    tory, use jar to archive each directory to a single jar
    file:
    example% ls
    audio classes images
    example% jar cvf bundle.jar audio classes images
    adding: audio/1.au
    adding: audio/2.au
    adding: audio/3.au
    adding: audio/spacemusic.au
    adding: classes/Animator.class
    adding: classes/Wave.class
    adding: images/monkey.jpg
    adding: images/at_work.gif
    example% ls -l
    total 142
    drwxr-xr-x 2 brown green 512 Aug 1 22:33 audio
    -rw-r--r-- 1 brown green 68677 Aug 1 22:36 bundle.jar
    drwxr-xr-x 2 brown green 512 Aug 1 22:26 classes
    drwxr-xr-x 2 brown green 512 Aug 1 22:25 images
    example%
    To see the entry names in the jar file using the jar tool
    and the t option:
    example% ls
    audio bundle.jar classes images
    example% jar tf bundle.jar
    META-INF/MANIFEST.MF
    audio/1.au
    audio/2.au
    audio/3.au
    audio/spacemusic.au
    classes/Animator.class
    classes/Wave.class
    images/monkey.jpg
    images/at_work.gif
    example%
    To display more information about the files in the
    archive, such as their size and last modified date, use
    the v option:
    example% jar tvf bundle.jar
    145 Thu Aug 01 22:27:00 PDT 1996 META-INF/MANIFEST.MF
    946 Thu Aug 01 22:24:22 PDT 1996 audio/1.au
    1039 Thu Aug 01 22:24:22 PDT 1996 audio/2.au
    993 Thu Aug 01 22:24:22 PDT 1996 audio/3.au
    48072 Thu Aug 01 22:24:23 PDT 1996 audio/spacemusic.au
    16711 Thu Aug 01 22:25:50 PDT 1996 classes/Animator.class
    3368 Thu Aug 01 22:26:02 PDT 1996 classes/Wave.class
    12809 Thu Aug 01 22:24:48 PDT 1996 images/monkey.jpg
    527 Thu Aug 01 22:25:20 PDT 1996 images/at_work.gif
    example%
    If you bundled a stock trade application (applet) into the
    following jar files,
    main.jar buy.jar sell.jar other.jar
    and you specified the Class-Path attribute in main.jar's
    manifest as
    Class-Path: buy.jar sell.jar other.jar
    then you can use the i option to speed up your applica-
    tion's class loading time:
    example$ jar i main.jar
    An INDEX.LIST file is inserted in the META-INF directory
    which will enable the application class loader to download
    the right jar files when it is searching for classes or
    resources.
    SEE ALSO
    keytool(1)
    JAR Files @
    http://java.sun.com/docs/books/tutorial/jar/
    JRE Notes @
    http://java.sun.com/j2se/1.3/runtime.html#exam-
    ple
    JAR Guide @
    http://java.sun.com/j2se/1.3/docs/guide/jar/index.html
    For information on related topics, use the search link @
    http://java.sun.com/
    13 June 2000 jar(1)

  • Images are not comming out when application is running through jar file.

    I have written an application program using j2sdk1.4.1 that needs your help.
    My application folder's contents.....................................................................................
         C:\Examination\Examination.class <-----This is the main class and application's entry point.
         C:\Examination\ExamBox.class
         C:\Examination\PaperSetterBox.class
         C:\Examination\pspBox.class
         C:\Examination\epBox.class
         C:\Examination\TimerBox.class
         C:\Examination\ReportCardBox.class
         C:\Examination\HelpBox.class
         C:\Examination\AboutBox.class
         C:\Examination\Images\(some jpg & gif files)
         C:\Examination\Sounds\(some au files)
    Compilation Report:     There was no error.
    Execution Report :     Was working properly using the command:- java Examination
    Now, I created a jar file for my application in the following steps.................................
              STEP-1:          Firstly, I created a text file(mainclassInfo.txt) that contains
              the line:--     Main-Class: Examination
              This line would be automatically added to the default manifest file when I would include the                name of that text file with the command to create the jar file.
              Location of the text file I created:     C:\mainClassInfo.txt
              STEP-2:          Then I went to C:\Examination and executed the following command(by using                'Command prompt'):--------------------------------------------------------------------
    jar cmf C:\mainClassInfo.txt Examination.jar Examination.class ExamBox.class PaperSetterBox.class pspBox.class epBox.class TimerBox.class ReportCardBox.class HelpBox.class AboutBox.class Images Sounds
    Finally, I got the jar file:-     Examination.jar
    Double clicking on it application ran as it was expected.
    Then, I thought, that as all the files & folders the application needed to run properly were packaged in the jar file; I should delete all the contents of the folder 'Examination', so that no one could see or use anything of the resources easily. I did that.
    So, then it became only:-- C:\Examination\Examination.jar
    Thereafter, I tried to run the application again and there a problem occurred! The application was running, but the images, those were to be used and shown by the application were missing somehow!!
    Moreover, when I kept a copy of those 2 folders('Images' and 'Sounds') into the C:\Examination and ran the application again all the images came out normally!
    I just can't understand why it's happening so mysterious?
    I don't want to leave anything of the resources in an open place; I mean, outside of the jar file. The images should be used and shown by the application.
    Help me please!

    The Image class itself does not have any methods for loading images from files so you must be using something more. Most methods for loading images from files have an overload that lets you use a URL, so you just need to use that method with a call to getResource like in the other thread. If you can't think of anything else, you can use ImageIcon to load an Image (the Image is returned by a call to ImageIcon.getImage). See also "how to use icons" from the swing tutorial:
    http://java.sun.com/docs/books/tutorial/uiswing/misc/icon.html

  • Images are not coming out when application running through jar file.

    I have written an application program using j2sdk1.4.1 that needs your help.
    My application folder's contents.....................
         C:\Examination\Examination.class <-----This is the main class and application's entry point.
         C:\Examination\ExamBox.class
         C:\Examination\PaperSetterBox.class
         C:\Examination\pspBox.class
         C:\Examination\epBox.class
         C:\Examination\TimerBox.class
         C:\Examination\ReportCardBox.class
         C:\Examination\HelpBox.class
         C:\Examination\AboutBox.class
         C:\Examination\Images\(some jpg & gif files)
         C:\Examination\Sounds\(some au files)
    Compilation Report:     There was no error.
    Execution Report :     Was working properly using the command:- java Examination
    Now, I created a jar file for my application in the following steps.................................
              STEP-1:          Firstly, I created a text file(mainclassInfo.txt) that contains
              the line:--     Main-Class: Examination
              This line would be automatically added to the default manifest file when I would include the                name of that text file with the command to create the jar file.
              Location of the text file I created:     C:\mainClassInfo.txt
              STEP-2:          Then I went to C:\Examination and executed the following command(by using                'Command prompt'):--------------------------------------------------------------------
    jar cmf C:\mainClassInfo.txt Examination.jar Examination.class ExamBox.class PaperSetterBox.class pspBox.class epBox.class TimerBox.class ReportCardBox.class HelpBox.class AboutBox.class Images Sounds
    Finally, I got the jar file:-     Examination.jar
    Double clicking on it application ran as it was expected.
    Then, I thought, that as all the files & folders the application needed to run properly were packaged in the jar file; I should delete all the contents of the folder 'Examination', so that no one could see or use anything of the resources easily. I did that.
    So, then it became only:-- C:\Examination\Examination.jar
    Thereafter, I tried to run the application again and there a problem occurred! The application was running, but the images, those were to be used and shown by the application were missing somehow!!
    Moreover, when I kept a copy of those 2 folders('Images' and 'Sounds') into the C:\Examination and ran the application again all the images came out normally!
    I just can't understand why it's happening so mysterious?
    I don't want to leave anything of the resources in an open place; I mean, outside of the jar file. The images should be used and shown by the application.
    Help me please!

    double post http://forum.java.sun.com/thread.jspa?threadID=582311

  • Get list of classes present in an applet's Jar file?

    I have an applet for drawing diagrams, which is bundled in a jarfile together with classes for each type of element in the drawing (e.g. a class for drawing 2-input NAND gates, a class for J-K flip-flops, and so on). When I add a new type of drawing element I have to modify the applet to add the new class to the applet's "Insert" menu to allow the element to be inserted. What I want to do is to search the jarfile containing the applet for any classes derived from DrawingElement and add them automatically to the Insert menu when the applet is inited. I presume this would require using getClass().getClassLoader() to get the class loader that read the JAR file, but from there it would seem I need to know the name of the resource to load. Is there a way of browsing the list of resources in the JAR file?

    AndrewThompson64 wrote:
    That 'modify the applet' is not strictly necessary. The list of menu items and classes might be passed to the applet as applet parameters, or as a property file or XML (or whatever) that defines the available elements.I could do this -- I'm just trying to avoid getting the list out of step with the contents (or if you prefer, I'm just being lazy!).
    Is there a way of browsing the list of resources in the JAR file?Yes and no. You might try this general strategy (untested).
    1) Gain an URL to a resource in the Jar in which the plug-ins exist.
    2) Parse that URL for everything before the '!' symbol to get an URL for the Jar itself.
    3) Get an InputStream from the Jar via URL.openStream().
    4) Get a ZipInputStream by wrapping the InputStream.
    5) Iterate the ZipEntry(s) to identify classes in the correct package, and store them in a collection of some type.
    6) Iterate the collection and check each one for extending DrawingElement, using reflection.
    I am guessing step 6 will require the applet to be trusted.Sounds plausible, and I'll give it a whirl. However, I hadn't thought about the "trusted" bit of this; maybe I can just create new instances and cast to DrawingElement, ignoring any that throw exceptions. I'll have to give it a go and see what happens.
    BTW - once you have the right classes, how do you get the screen name of them? Is the name defined in one of the attributes of a DrawingElement? What prevents name clashes?Plan A: I have a getIdentification() method that returns a string identifying the element, but I have to keep this unique the hard way (by hand).
    Plan B: use the class name with some prettification (e.g. have a class _2_input_NAND_gate which gets displayed as "2 input NAND gate") so that the compiler does the work of keeping it unique. Not sure I like this, though.
    Many thanks for your help.

Maybe you are looking for

  • Function to extract characteristics and its value from PI sheet

    Hi experts,   I am working on a report to generate Avg. deckle for the month form the PI sheet. In the PI sheet the data that is displayed is basically the message characteristcs and its value. Please tell me ne function that will give me the related

  • Zen Nano Plus- help can't turn it

    I bought a Zen Nano Plus back in May, it worked fine until now. Now it will turn on half way then shut right off. My computer will recognize it, but the software won't. i can use all the help.

  • JSSE causes OSB business services to receive Socket Closed

    Using WL 10.3.3 & OSB 11gR1 on jrockit 1.6.0_45  Redhat: After enabling the "Use JSSE SSL" option in the managed servers's SSL tab ( because web service clients want to use SHA256 certificates ), OSB business services ( outbound to service providers

  • Database toolkit installati​on problem

    Being a total newbie with LabVIEW 7.1, I find myself dealing with a lot of problems/questions. I want to connect to a database. I have tried downloading some sample code like this http://forums.ni.com/ni/board/message?board.id=170​&message.id=26786&q

  • Log and Transfer Window unable to access all the files that were stored a P2 card

    I have a 64gb P2 card that was filled to capacity (63.09gb) on a recent shoot with a Panasonic HPX170 camcorder.  An addlitional 16gb card was in the second slot. I transferred the files from the 64gb P2 card to my iMac as usual, and did not see any