Include rt.jar class files in my own jar file to run 1.2+ applets on MS JVM

My problem is this. I'm writing an applet (which includes 1.2 classes) for my organization (over 2000 NT workstations) in which no one has administrative privelages to install Sun's JRE 1.2 or greater. The target browser is IE 5. Our NT admins are having problems pushing the JRE out so my only two options are to rewrite everything as 1.1 or somehow include the missing class files from rt.jar.
I really do not want to rewrite it all!
I was able to extract the missing class files (i.e. /java/util/HashMap.class) but I cannot figure out how to get the IE JVM to use them. Things I have tried:
1. jarred up all my class files along with the missing classes from rt.jar.
$ jar cvf test.jar *.class java
added manifest
adding: ArrayObj.class(in = 731) (out= 448)(deflated 38%)
adding: DivMonGrid.class(in = 1509) (out= 812)(deflated 46%)
adding: GridLayout2.class(in = 2720) (out= 1514)(deflated 44%)
adding: Item.class(in = 317) (out= 232)(deflated 26%)
adding: Row.class(in = 588) (out= 365)(deflated 37%)
adding: Screen.class(in = 672) (out= 416)(deflated 38%)
adding: Site.class(in = 545) (out= 360)(deflated 33%)
adding: divmonDash.class(in = 12506) (out= 6892)(deflated 44%)
adding: java/(in = 0) (out= 0)(stored 0%)
adding: java/util/(in = 0) (out= 0)(stored 0%)
adding: java/util/HashMap.class(in = 6668) (out= 3461)(deflated 48%)
adding: java/util/HashMap$1.class(in = 931) (out= 513)(deflated 44%)
adding: java/util/HashMap$2.class(in = 800) (out= 454)(deflated 43%)
adding: java/util/HashMap$3.class(in = 1608) (out= 904)(deflated 43%)
adding: java/util/HashMap$EmptyHashIterator.class(in = 592) (out= 358)(deflated 39%)
adding: java/util/HashMap$Entry.class(in = 1505) (out= 775)(deflated 48%)
adding: java/util/HashMap$HashIterator.class(in = 1814) (out= 1096)(deflated 39%)
$ jar -tf test.jar
META-INF/
META-INF/MANIFEST.MF
ArrayObj.class
DivMonGrid.class
GridLayout2.class
Item.class
Row.class
Screen.class
Site.class
divmonDash.class
java/
java/util/
java/util/HashMap.class
java/util/HashMap$1.class
java/util/HashMap$2.class
java/util/HashMap$3.class
java/util/HashMap$EmptyHashIterator.class
java/util/HashMap$Entry.class
java/util/HashMap$HashIterator.class
RESULT: IE JVM complains classnotfoundexception (its complaining about not finding HashMap.class)
2. Tried to just place missing *.class files in same directory as my class files
RESULT: Compiler error (complaining about file not be in correct path package) I understand this because when it was created the package statement has the class file in java/util/.
If anyone has done this before or knows how to do it, please help me out.
Thanks!

When the collection classes first came out, I think they were available in a separate jar (although the package name may be slightly different). If it's just collection classes, that might be worthwhile looking at.
The MS JVM may be spewing because the class format is too new; you may try with rt.jar classes from an older JVM (such as JDK 1.2), or try to recompile them from source using -target 1.1.

Similar Messages

  • Applets reading files in their own jar file

    I know there is no way to get my applet to read a file on the hard disk. But
    could I read one that I include in with the .jar file that I create for my applet?
    What about using a Resource type of file? Is this possible?
    Thanks

    Here's a little code stub I used to read a properties file from rt.jar    Properties p = new Properties();
        InputStream is = ClassLoader.getSystemClassLoader().getResourceAsStream
         ("java/awt/resources/awt.properties");
        if (is == null) System.out.println("NULL");
        else try { p.load(is); }
        catch (Exception exc) { System.out.println("Exception"); }
        p.list(System.out);You should be able to substitute your path & properties file

  • How  to include the inner classes in a jar file in netbeans ide

    Dear java friends
    how to say to netbeans ide that it has to include the
    inner classes in the jar file.
    (i have one single applet class
    with two inner classes that show up
    in the build/classes file but not in the jar).
    The applet works in the viewer but not
    in the browser (I believe because the
    xxx$yyy etc should be in the jar)
    willemjav

    First, please stop posting the same question multiple times:
    Duplicate of http://forum.java.sun.com/thread.jspa?threadID=5269782&messageID=10127496#10127496
    with an answer.
    Second, If your problem is that you can't do this in NetBeans, you need to post to somewhere that provides NetBeans support - like the NetBeans website's mailing list. These forums do not support NetBeans (or any other IDE) - they are Java language forums.

  • Including a jar file inside an executable jar file

    Is it possible to include a jar file inside another (executable) jar file such that the included file is part of the class path for the outer file? If so, how do you specify this in the classpath in the manifest?

    Russ_Bjork wrote:
    Is it possible to include a jar file inside another (executable) jar file such that the included file is part of the class path for the outer file?No. Actually, I suppose it would be possible if you do all the 'heavy lifting', but Java is not designed to handle Jars within Jars.
    What do you see as the advantage of doing that?
    Is your app. a rich client (e.g. Swing, AWT, SWT..)?
    Can you distribute the app. from a server or the internet?

  • How to run a jar file which needs another jar to be in the class path

    Hi,
    I need to execute a jar, which needs another jar to be in the classpath.
    If I run like
    java -classpath <jar1 name> -jar <main jar>
    It is giving classnotfoundexception, where as the class is available in the <jar1 name>.
    so, currently I am doing like this
    In the manifest file i have given like
    Main-Class: <class name>
    Class-Path: <jar name> <jar name2>
    then it is running fine. But, if I want to change the jar location again I need to changed the manifest file.
    Is there any way to do this? Pls help me.

    How about
    java -cp jar1.jar;jar2.jar com.acme.MainClass
    You won't need to worry about the manifest file after that and you can make a bat files (or .sh file in *nix) for it.                                                                                                                                                                                                                                                                                                                                                                       

  • Classes+resources in JAR: have to add each single Jar file to CLASSPATH?

    Hello,
    For my application, I plan to easily embed plugins that can be added by the user by copying it into a subfolder "plugins".
    Now, I start my app from a shellscript and in order to load resources from within some of these Jars (e.g. using Class.getResourceAsStream() ), it only works if I explicitly add the specific Jar filename to the classpath from the shellscript.
    I read in a German Java book, that also just using folder names is enough, but it does not work for me:
    Works:
    $JAVA_HOME/bin/java -Djava.library.path="./lib" -classpath "./lib:./plugins/test.jar" test.AppFails:
    $JAVA_HOME/bin/java -Djava.library.path="./lib" -classpath "./lib:./plugins/" test.AppIs it really required to add Jars explicitly, so that e.g. my shellscript has to make a Jar listing of that folder in order to pass them as classpath files?
    Thanks and regards,
    Timo

    No, you don't have to do it that way. What you need
    to do is to have your progam create a URLClassLoader
    pointing to all the jars in the plugin directory.
    Then request your plugin classes from that, rather
    than Class.forName();
    You need to create an array of file URLs for the
    jars, use File.listFiles() and then File.toURL() on
    each ..jar you find.
    p.s. If you do it this way make sure your plugin
    classes are not on the classpath.
    Hmm. Cool. I had no idea. Thanks for correcting me.

  • Include a JSP file located in a JAR

    how is it possible to include a jsp file which is located in a jar? perhaps someone has already a solution for this hoping
    what I already have found out is that jasper parser supports loading JSP files out of JARs, indeed. but when using a <%@import file="foo.jsp"%> directive, this special method is not called. is there some workaround? should I set some special property?
    thx

    Did you ever figure this one out?

  • Read from own jar file

    Using netBeans IDE 4.1 I wrote a stand-lone application contained in a single jar file. It transforms xml files into drawings. I'd like to distribute the application with some sample xml-files in that one jar-file. But how can I make the application read these embedded files?
    I looked at the SplitPaneDemo that uses a list of images to display.
    http://java.sun.com/docs/books/tutorialJWS/uiswing/components/example-1dot4/SplitPaneDemo.jnlp
    works.
    I also downloaded
    http://java.sun.com/docs/books/tutorialNB/download/tut-examples.zip
    extracted uiswing/components/example-swing
    created a new project from existing sources
    made SplitPaneDemo the main class
    and run it after a clean build.
    The images are in the jar-file, but no images appear.
    Is the problem in the second attempt a missing classpath? In that case: how can I prevent my a-technical users having to set a classpath, or how can I find out and use the absulute path to the jar-file?
    Jo

    But my browser (FireFox 1.0.7 on Windows XP Home edition) isn't launched (and no error shown) with
    String url = "" +getClass().getClassLoader().getResource("path/to/page.html");
    try {
                Runtime.getRuntime().exec( "rundll32 url.dll,FileProtocolHandler " + url);
    } catch (java.io.IOException e) {
                javax.swing.JOptionPane.showMessageDialog
                        ( this
                        , url
                        , "debug info"
                        , javax.swing.JOptionPane.INFORMATION_MESSAGE
    }

  • Can i load a class in subdirectoy  inside a jar file using applet tag?

    hi every one.. thank you for reading ... i am really in dire need for the solution..
    my problem is that i have a jar file contianing a package which inturn contains my applet class...
    i am trying to access this applet class using a applet tag in html file. this html file is in same directory as the jar file. i am having no problems in windows but when i am doing this in linux apache server i was getting class not found exception. (already checked the file permissions). and when i am successful when using simple package directory instead of jar file . so gist of my quesition is "can i load a class in subdirectoy inside a jar file using applet tag in a html file"?

    When you tested in Windows were you using Internet Explorer? On Linux you will be using a different browser, usually Mozilla of some version, or Firefox. Note that the HTML tags for applets will be different between the browsers if you are using the object tag. Principally the classid value for the object tag will differ between Firefox and Internet Explorer.

  • Web application in EAR not finding class in APP=INF/lib jar file

    Hi,
    I have read some posts regarding this but am still not able to figure out anything.
    I have a war file in my EAR along with some EJB jars. I have the common jars in the APP-INF/lib. The EJBs can find the classes in the common jars easily. But the Web app gives me a NoClassDefFoundError when trying to load a class from a common jar.
    Here is the structure:
    <pre>
    EAR
    |---WAR
    |---WEB-INF
    | |---lib
    | |---a.jar (A.class)
    |---APP-INF
    |---lib
    |---b.jar (B.class)
    </pre>
    Class A is trying to load class B and I get the NoClassDefFoundError for class B
    Thanks for any help,
    Sameet

    I found the problem. The web-app was finding the class in the APP-INf/lib. But the problem was being caused due to a reference to another class that was being loaded by the webapp classloader which was not visible to the class inside the common jar. The solution was to make sure both classes were being loaded by one class loader.
    Thanks anyway
    Sameet

  • Can I synchronize all iBooks documents (including pdf files of my own) using iCloud?

    It looks impossible to sync iBook files between devices using iCloud. It works for iBook files bought at iTunes, but not for pdf files of my own. It should work the same as for emails, note's, foto's and other stuff that is synchronized using iCloud. Any suggestions besides using other cloud storage?

    Saw another thread..... Will try Dropbox....

  • How to enable full autocomplete description with own JAR ?

    Hi there,
    To put my problem simply: I've created a JAR file and wish to utilize it within another Java project. Therefor I've imported the JAR file in my project path (I've done this in Eclipse and IntelliJ) and in both IDEs the JAR file works just fine.
    But... I wish to use the autocompletion (yes, I'm a bit lame) in both IDEs. Now, whenever I import and call a function of a standard class (like java.util.Vector i.e.), the autocomplete pops up when writing the call to that specific function (i.e. add(Object o)). The autocomplete shows:
    - the parameter names & types;
    - the return type.
    Now that's what I like to see also when calling a function of a self written class included in my own JAR. The only thing the autocomplete shows is the parameter types, not their names.
    How on earth do I enable my autocompletion to show also the names of the parameters ?
    I thought the blame could be the IDEs, but it's rather unlikely when two different IDEs behave similar in this matter. And it's not a bug in JAR itself. Perhaps I'm missing a specific argument when I jar up *.class files (I even tried to jar up the *.java files along, but without any results). Or perhaps it is something totally not possible (but I doubt that).
    So, who's got the answer to this matter? Thanks in advance!
    Greetings,
    Naifud

    But I did import the class I'd like the
    autocompletion on.With an "import" statement, or do you mean you added its JAR to the build path? I mean the former. That sometimes helps, and usually works for me.
    An example of how the a.c. looks like with a standard
    Java class/import:
    public object get(int index, String objectName)
    And this is how the a.c. looks like when used on my
    own class:
    public object get(int, String)Aaaaaah. That's what you mean. I thought you meant it doesn't work at all.
    Well... may I safely assume that you neither included the Javadocs nor the source code in that JAR? How would the IDE know what you call your parameters like? The binary code doesn't tell.
    I've posted this already in a forum for the Java
    IDEs, but instead of providing a proper solution,
    they turned the topic into a flaming war about that
    Eclipse would be far superiour than IntelliJ and
    otherwise. So I tried it over here, hoping for more
    civilisation ;).Forget it.

  • How to include Managed bean class in build sciprt for taskflow (Jdev 11.4)

    Hi,
    I've developed a custom taskflow to be deployed in the webcenter spaces. The taskflow that I developed contains managed beans. I am using oracle provided build script with the sample application, to deploy custom taskflow. After the build, we don't see any .class files (managed bean files) in the generated war file. Once we deploy the taskflow into the space, it is failing may be because the managed bean class files are missing in the <taskflow>.war. Am i missing something? Should we specifically include the .class files in the build script?
    Below is the oracle provide build script..
    <?xml version="1.0" encoding="US-ASCII" ?>
    <!--Ant buildfile generated by Oracle JDeveloper-->
    <!--Generated Sep 29, 2009 11:47:41 PM-->
    <project name="WebCenterSpacesSharedLibExtension" default="all" basedir="."
    xmlns:wls="oracle.webcenter.tools.wls">
    <property file="../config.properties"/>
    <property file="build.properties"/>
    <import file="internal-targets.xml"/>
    <taskdef resource="net/sf/antcontrib/antcontrib.properties">
    <classpath>
    <pathelement location="${jdeveloper.install.home.directory}/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar"/>
    </classpath>
    </taskdef>
    <target name="clean-stage"
    description="Cleans the output directory and generates the war"
    depends="clean, stage"/>
    <target name="deploy-shared-lib"
    depends="init-wls"
    description="Deploy the extending WebCenter shared library">
    <echo> ---------------------------- </echo>
    <echo> ${wls.userconfig} ${wls.userkey} ${wls.host}:${wls.port} ${oracle.jdeveloper.deploy.dir}/exploded ${wls.webcenter.app.target} ${customer.library.name}</echo>
    <exec logerror="true"
    executable="${jdeveloper.install.home.directory}/oracle_common/common/bin/${wlst.executable}"
    dir="${jdeveloper.install.home.directory}/oracle_common/common/bin">
    <!--TODO:ExpDeploy Uncomment line after this and comment the one after that to deploy exploded. -->
    <arg line="${extending.spaces.home.dir}/WebCenterSpacesSharedLibExtension/extspaces.py ${wls.userconfig} ${wls.userkey} ${wls.host}:${wls.port} ${oracle.jdeveloper.deploy.dir}/exploded/${customer.library.name}.war ${wls.webcenter.app.target} ${customer.library.name}"/>
    <!--TODO:ExpDeploy Uncomment line below and comment line above to have non-exploded deploy -->
    <!--arg line="${extending.spaces.home.dir}/WebCenterSpacesSharedLibExtension/extspaces.py ${wls.userconfig} ${wls.userkey} ${wls.host}:${wls.port} ${oracle.jdeveloper.deploy.dir}/${shared.library.name} ${wls.webcenter.app.target} ${customer.library.name}"/-->
    </exec>
    <echo> ---------------------------- </echo>
    <echo> Restarting the app </echo>
    <echo> ---------------------------- </echo>
    <exec logerror="true"
    executable="${jdeveloper.install.home.directory}/oracle_common/common/bin/${wlst.executable}"
    dir="${jdeveloper.install.home.directory}/oracle_common/common/bin">
    <arg line="${extending.spaces.home.dir}/WebCenterSpacesSharedLibExtension/redepwc.py ${wls.userconfig} ${wls.userkey} ${wls.host}:${wls.port} "/>
    </exec>
    </target>
    </project>
    Thanks in advance
    Nitin

    Hi,
    I've developed a custom taskflow to be deployed in the webcenter spaces. The taskflow that I developed contains managed beans. I am using oracle provided build script with the sample application, to deploy custom taskflow. After the build, we don't see any .class files (managed bean files) in the generated war file. Once we deploy the taskflow into the space, it is failing may be because the managed bean class files are missing in the <taskflow>.war. Am i missing something? Should we specifically include the .class files in the build script?
    Below is the oracle provide build script..
    <?xml version="1.0" encoding="US-ASCII" ?>
    <!--Ant buildfile generated by Oracle JDeveloper-->
    <!--Generated Sep 29, 2009 11:47:41 PM-->
    <project name="WebCenterSpacesSharedLibExtension" default="all" basedir="."
    xmlns:wls="oracle.webcenter.tools.wls">
    <property file="../config.properties"/>
    <property file="build.properties"/>
    <import file="internal-targets.xml"/>
    <taskdef resource="net/sf/antcontrib/antcontrib.properties">
    <classpath>
    <pathelement location="${jdeveloper.install.home.directory}/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar"/>
    </classpath>
    </taskdef>
    <target name="clean-stage"
    description="Cleans the output directory and generates the war"
    depends="clean, stage"/>
    <target name="deploy-shared-lib"
    depends="init-wls"
    description="Deploy the extending WebCenter shared library">
    <echo> ---------------------------- </echo>
    <echo> ${wls.userconfig} ${wls.userkey} ${wls.host}:${wls.port} ${oracle.jdeveloper.deploy.dir}/exploded ${wls.webcenter.app.target} ${customer.library.name}</echo>
    <exec logerror="true"
    executable="${jdeveloper.install.home.directory}/oracle_common/common/bin/${wlst.executable}"
    dir="${jdeveloper.install.home.directory}/oracle_common/common/bin">
    <!--TODO:ExpDeploy Uncomment line after this and comment the one after that to deploy exploded. -->
    <arg line="${extending.spaces.home.dir}/WebCenterSpacesSharedLibExtension/extspaces.py ${wls.userconfig} ${wls.userkey} ${wls.host}:${wls.port} ${oracle.jdeveloper.deploy.dir}/exploded/${customer.library.name}.war ${wls.webcenter.app.target} ${customer.library.name}"/>
    <!--TODO:ExpDeploy Uncomment line below and comment line above to have non-exploded deploy -->
    <!--arg line="${extending.spaces.home.dir}/WebCenterSpacesSharedLibExtension/extspaces.py ${wls.userconfig} ${wls.userkey} ${wls.host}:${wls.port} ${oracle.jdeveloper.deploy.dir}/${shared.library.name} ${wls.webcenter.app.target} ${customer.library.name}"/-->
    </exec>
    <echo> ---------------------------- </echo>
    <echo> Restarting the app </echo>
    <echo> ---------------------------- </echo>
    <exec logerror="true"
    executable="${jdeveloper.install.home.directory}/oracle_common/common/bin/${wlst.executable}"
    dir="${jdeveloper.install.home.directory}/oracle_common/common/bin">
    <arg line="${extending.spaces.home.dir}/WebCenterSpacesSharedLibExtension/redepwc.py ${wls.userconfig} ${wls.userkey} ${wls.host}:${wls.port} "/>
    </exec>
    </target>
    </project>
    Thanks in advance
    Nitin

  • How to import custom java jar/class into oracle to be used in java proc ?

    Hi
    I would like to know how to import custom java jar/class files into oracle to be used in java stored procedure.
    I am developing a oracle pl/sql procedure to call java program. The java program will be created as procedure and will be published.
    But, my question is that I do have a other external jar/class file that need to be imported into this java program.
    example
    raise_sal.java
    import java.util.*;
    import oracle.sql.*;
    <<reference other java programs >>
    import cmpmsgsvc.xxxx.* ;
    import cmpmsgsvc.yyyy.* ;
    import cmpmsgsvc.zzzz.* ;
    how do I import the cmpmsgsvc jar/class file into oracle so that I don't have any
    compilation errros on raise_sal.java program ??
    what are the steps to import/compile and validate to do this?
    thanks for your help in advance.
    Thanks
    rrb.

    Kuassi
    Problem is that, I have 6 jar files that are needed to be included in the main java program. And, there are more than 50+ classes, propertiers in those 6 jar files.
    It might be not good idea to have all those 50+ classes in the production database.
    Is there anyway that I keep all those 6 jar files in unix box (our's is oracle erp installation with oracle being installed on unix box) and just refer them in the main java program. I mean database will be loaded with main java program and it should able to refer other 6 jar files from unix.
    if we create a directory and keep all jar files in there and include that directory in classpath variable, does this works? or what is other method?
    Please let me know.
    Thanks

  • Gif file not found in JAR from Java Application

    Hello Forumers,
    Could some one please explain how to create a JAR file from where I can get a GIF file. I have tried a number of different ways but it allways fails. (I have tried to add the GIF files using the jar command and I have tried to add it using WinZip after the jar is created).
    To isolate the problem I created this very simple program, the program works very well when the gif file resides on the directory from where I run the Application, but when I remove it from the directory it fails. I have tried to put the GIF file in the JAR in a number of different ways but it allways fails. (I have also tried with and without slash before the name of the GIF). I guess the problem is the way I create the JAR file
    import java.io.*;
    public class GifTest
    { public static void main(String args[])
    { InputStream in = GifTest.class.getResourceAsStream("/open.gif");
    if (in==null)
    System.out.println("Null returned");
    else
    System.out.println("OK");
    Any Hints appreciated
    /Kjell

    Hi,
    here is a small application using my own class GetImageIcon.
    Normally I have this "help-class" in a utility-package to use it from all my projects without copying. For this example I copied the code in the test application. Feel free to use the code of the class like you want. For me it works fine.
    Do the following:
    1. Create a folder called /meta-inf under the folder where the class-files are. Use a text-editor and create a file saved as "manifest.mf".
    manifest.mf tells the jar-file which is the main-class from where the application will start when double-clicked.
    It only has to contain one line:
    Main-Class: GifTest
    2. Compile and create the jar file. I made a bat-file containing:
    javac -verbose GifTest.java
    %pause
    REM Create Jar-File
    jar cmf meta-inf/manifest.mf GifTest.jar *.class *.gif
    REM Show Table of Content of the Jar-File
    jar tf GifTest.jar
    %pause
    So you can see what's in the jar-file.
    3. When you double-click on the jar-file the application is executed. So it is easier to use for the users. They don't have to type in anything on the command-line. You can deploy this jar-file to any client and run it. The only thing you have to do, is to install the JRE on the clients.
    I develop with JDK 1.3.1 and JRE 1.3.1 is installed on the clients of the company I work for.
    //Begin of the code
    import java.io.*;
    import java.awt.*;
    import javax.swing.*;
    import java.util.jar.*;
    public class GifTest extends JFrame
            protected JLabel m_title;
            protected ImageIcon m_image;
            static File file;
            //You have to define the name of the jar-file
            static String jarFile = "GifTest.jar";
            //Instance of the class GetImageIcon
            protected GetImageIcon gii = new GetImageIcon();
            public GifTest()
                    super("GifTest");
                    setSize(400,200);
                    //the name of the image and the name of the jar-file the image resides in
                    m_image = gii.getImageIcon("orb.gif", "GifTest.jar");
                    m_title = new JLabel(null, m_image, SwingConstants.CENTER);
                    getContentPane().add(m_title, BorderLayout.NORTH);
            public static void main(String argv[]) {
                    GifTest frame = new GifTest();
                    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                    frame.setVisible(true);
    public class GetImageIcon{
    * @param fileName the full qualified name of the file
    * from the root of your application. use a "/" before the
    * fileName, eg. /images/warning.gif
        public ImageIcon getImageIcon(String fileName, String jarName) {
            int counter, c, i = 0;
            byte buffer[];
            JarFile  jfile;
            JarEntry jentry;
            InputStream in;
            ImageIcon m_image;
            try{
                    // Create Jar-File object from JarFile
                    jfile = new JarFile(jarName);
            catch(Exception ex){
                    System.out.println("JarFile-Problem " + "\n" + ex);
                    return null;
            try{
                    // create Jar-Entry object from File-Name in JarFile
                    jentry = jfile.getJarEntry(fileName);
            catch(Exception ex){
                    System.out.println("JarEntry-Problem " + "\n" + ex);
                    return null;
            try{
                    // create InputStream from JarEntry
                    in = jfile.getInputStream(jentry);
            catch(Exception ex){
                    System.out.println("JarEntry-Problem " + "\n" + ex);
                    return null;
            try{
                    //get uncompressed size of entry data in Jar-File and create byte-array with this size
                    buffer = new byte[(int)jentry.getSize()];
                    //write int-value 'c' (casted to byte) with read() and while-loop in byte-Array
                    while((c = in.read()) != -1){
                            buffer[i] = (byte)c;
                            i++;
            catch(Exception ex){
                    System.out.println("in.read()-Problem " + "\n" + ex);
                    return null;
            try{
                    //create ImageIcon with byte-Array 'buffer'
                    m_image = new ImageIcon(buffer);
            catch(Exception ex){
                    System.out.println("ImageIcon-Problem " + "\n" + ex);
                    return null;
            // return the created ImageIcon
            return m_image;
    }

Maybe you are looking for

  • Hot Synch Problems with Centro and Computer

    Transfered phone numbers from old phone and added three  months of dates on the calendar.  Hot Synched and it transferred to my laptop.  Went back to Verizon and they beamed my PalmVx info into phone.  Got all the addresses and phone numbers, but it

  • How to set two Conditions Simultaneously in set where clause

    Hi, I have a messgechoice item , and i need to fire messagechoice VO with two conditions. For Eg:-- we have three Items ProjectContractor& Work Order on a custom Page , now i need work order list should populate on lelection of project & contractor b

  • Groups and Authorization

    Hello, I'm looking for the best way to use groups as a means to authorize. I have set up groups such as 'Group A', 'Group B', and I tried to set up a PL/SQL authorization scheme as follows: wwv_flow_user_api.current_user_in_group('Group A') But the P

  • BLOG WEBSITE IN IWEB

    I created an ARTIST page by using the ENTRY page -- that has thumbnails (artwork) and an artist statement -- the artist statement continues on another page that opens to more artwork and the complete artist statement. When I add more than 5 thumbnail

  • Find number of attachments

    How can I find the number of attachments in a message? I've done some research, but still can't figure it out :(