1.4.2_x binary (jar) incompatibility

I built an application with JDK 1.4.2_03. The application is put into a jar file. Whereas it runs with 1.4.2_03 and 1.4.2_04 but not with the runtime 1.4.2_09, which complains about an "Invalid or corrupt jarfile".
I can run the application with the elder versions but the phenomenon is still strange.
C:\source\java\ebank2_util\smsunlock>C:\langs\java\j2sdk1.4.2_04\bin\java.exe -jar pro-ebank_sms_unlock.jar
logging in jdbc:oracle:thin:@aloe-prod:1521:aloe
logged in :-)
C:\source\java\ebank2_util\smsunlock>j9.bat
C:\source\java\ebank2_util\smsunlock>C:\langs\java\j2re1.4.2_09\bin\java.exe -jar pro-ebank_sms_unlock.jar
Invalid or corrupt jarfile pro-ebank_sms_unlock.jar

Please disregard!!

Similar Messages

  • Binary Jar file?

    How can we create binary Jar file in order to hide the code from the client?
    Note that: The .xml and .html files are accessible/understandable in Jar file. I need somehow hidden this codes when deploy it.

    Still couldn't find a solution for this.(Also review other fourms). Would appreciate any command on this.

  • Binary JAR file format

    Hi out there,
    does anybody know where I can find the specification for the binary JAR file format?
    It doesn't follow the ZIP spec, there must be some additions.
    Here is my problem:
    I'm reading the 1. local file header, there compressed and uncompresed size is 0. Bit 3 of the
    general purpose bit flag is not set so there is no Data descriptor section and there should also be no
    file data section (size is 0, extra field also 0). But there are still some
    bytes until the next local file header starts. What are the bytes in between??
    Somewhere in the middle of the 2 local file headers is the 0x08074b50 signature, which is mentioned
    in the zip spec in combination with Spanned/Split archives !??
    If I'm reading a ZIP file generated with WinZip it is working fine, but when I'm reading a jar generated with
    the jar tool there are this mysterious bytes, which I cannot interpret.
    Thanks in advance for your help.
    Cheers,
    Steffen

    okay, guys just in case someone is interested (doesn't seem like, but anyhow):
    YES, the jar tool is not sticking exactly to the zip specification. I found out when I was
    browsing through the source code of the java distribution. The local file headers are not
    filled with the size information!
    Quote: * We'd like to initialize the sizes from the LOC, but unfortunately
    * some ZIPs, including the jar command, don't put them there.The solution for it, which I think is the standard for zip processing anyhow, is reading the
    central directory of the zip file first. There you get all info including also the size, etc. of the entries
    and also the offset to the local file header.
    The drawback is that it's a little more complex to read a file from the end and not from the beginning
    because you have to find the beginning of the central directory first, but well ...
    Okay, that's it. Have fun!

  • Xdb.jar and ojdbc14.jar incompatibility ( XMLType.createXML() ) ??

    I am using the latest xdb.jar (from xdk_java_9_2_0_5_0.zip) and ojdbc14.jar
    and it appears that xdb.jar calls a method that does not exist in ojdbc14.jar.
    It happens when executing
    OPAQUE opaque = rset.getOPAQUE("value");
    XMLType xt = XMLType.createXML(opaque); // <-- here
    The exact error message is:
    java.lang.NoSuchMethodError: oracle.jdbc.internal.OracleConnection.getProtocolType()Ljava/lang/String;
         at oracle.xdb.XMLType.initConn(XMLType.java:2072)
         at oracle.xdb.XMLType.<init>(XMLType.java:903)
         at oracle.xdb.XMLType.createXML(XMLType.java:493)

    Hi,
    There are known problems with xdb.jat that is bundled with XDK 9205.
    As a workaround, you need to use an older version of xdb.jar from either XDK-9.2.0.3 or XDK-9.2.0.4 since the mentioned exception is generally thrown due to problems in xdb.jar that comes with XDK-9205.
    If you do not have any of these versions of XDK, you could use the xdb.jar that comes with the database 9.2.0.3. The xdb.jar is present in <oracle_home>/rdbms/jlib folder.
    Hope that helps.
    Shefali

  • Classpath craziness!!!

    This is just too wierd!
    My classes are in c:\javaclasses
    My java source files are in c:\java\FoodCoster
    I'm not using packages.
    From the command prompt, if I navigate to c:\java\FoodCoster and
    execute java Driver2 -classpath c:\javaclasses
    I get 3 class not found exceptions.
    Within my IDE ( JCreator ), the program runs with no problems.
    Settings in the IDE indicate c\javaclasses as being prepended to the
    CLASSPATH at run-time.
    What is up with this?
    I even downloaded JPadPro and the same scenario: fine in the IDE,
    class not found exceptions from the command line.
    Change your mail options at http://p2p.wrox.com/manager.asp or
    to unsubscribe send a blank email to [email protected]

    First off, many thanks to Chuck Bing...I hope you slept well...;)
    HOOORAYYY!!!! Finally got it running!!....and learned a lot about
    class paths in the process...;)
    OK...When I was getting the 3 "class not found exception" popups,
    those were notices/JOptionPanes I had defined in the catch blocks for theSQLexception.
    I got 3 because there are 3 SQL queries that are executed when the program loads. But I had worded them in such a way that they "sounded" like they were system generated!
    Once I had determined that it was these "generic" error
    notices/popups I had coded, what were confusing me I modified each
    notice to tell me exactly where it was being generated, and in that
    way i was able to determine that the JVM was not finding the mysql
    jdbc driver, when launching from the command line. (Why it worked
    within the IDE I'd love to know ).
    So going back to the driver instructions I unpacked the files
    placed them in my application directories where specified and removed
    the classpath entry in the environment variables which pointed to the
    driver binary .jar file.
    ( This also makes it easier to transport the application as I won't
    need to mess with the users classpath )
    I can't thank all of you enough, for your time, ideas, and patience.

  • I can't find the package, "com.sun.faces.config.beans"

    Hi. To research the implementation mechnism of JSF, I downloaded JSF reference implementation source JAR from javaserverfaces.dev.java.net.
    But when I unziped the JAR and import these files into eclipse to compile this project, a serials of compile errors occurred. Making a comparation between binary JAR and source JAR, I found that some files contained in binary JAR weren't in the source JAR. For example, com.sun.faces.config.beans package exists in the jsf-impl.jar, but not in jsf-impl's source JAR. I ensure that the binary files and source files have the same version.
    Any advice is welcome. THX.
    null

    There are three source projects for JSF. The jsf-api, jsf-impl, and jsf-tools. The jsf-tools one contains the package you're looking for.
    I never understood why the JSF developers organized their projects this way. Basically, it looks like the jsf-tools project gets compiled into the jsf-impl jar. Thus it's not 1 project to 1 JAR. And confuses people like us!
    CowKing

  • Loading MySQL to Borland's Java

    I still can't connect to MySQL.
    I looked in the other threads' instructions, I think I am doing everything correctly.
    I still get the
    java.lang.ClassNotFoundException:org.gjt.mm.mysql.Driver
    exception on the
    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    command.
    This is my system:
    Java: Borland's JBuilder home edition.
    Operating System: Windows XP
    Driver I am trying to use: GNU's mm.mysql-2.0.14
    Relevant Directories:
    MySQL: C:\MySQL
    GNU's driver: C:\MySQL\mm.MySQL-2.0.14 (I thought it
    made sense to put it here.)
    Relevant Environment Variables:
    CLASSPATH:.;C:\MySQL\mm.MySQL-2.0.14\mm.mysql-2.0.14- bin.jar
    I have also tried:
    CLASSPATH:.;C:\MySQL\mm.MySQL-2.0.14\lib\jdbc2_0-stdext.jar
    CLASSPATH:.;C:\MySQL\mm.MySQL-2.0.14]\lib\jta-spec1_0_1.jar
    -and-
    CLASSPATH:.;C:\MySQL\mm.MySQL-2.0.14]\org
    I didn't set the environment variables
    path to C:\j2sdk1.4.0_01
    j2ee_home to c:\j2sdkee1.3.1
    java_home to c:\j2sdk1.4.0_01
    because I don't have any files on my computer that start
    with j2sdk. Apparently, JBuilder uses other files.
    I can use MySQL with the command line mysql command, but only from the c:\mysql\bin directory.

    I can't tell for sure from the information you give, but I think you're mixing apples and oranges. Here's an excerpt from the readme file that comes with the driver:
    MM.MySQL is distributed as a .jar archive containing the sources
    and class files as well as a class-file only "binary" .jar archive
    named "mysql-2.0.13-bin.jar".
    You will need to use the "jar" command-line utility that comes with your JDK
    to un-archive the distribution.
    Once you have un-archived the distribution .jar archive,
    you can install the driver in one of two ways:
    Either copy the org subdirectory and all of it's contents
    to anywhere you like, and put the directory holding the org subdirectory
    in your classpath, or...
    Put mysql-2.0.13-bin.jar in your classpath, either by adding the
    FULL path to it to your CLASSPATH enviornment variable, or putting it
    in $JAVA_HOME/jre/lib/ext.
    I placed mysql-2.0.13-bin.jar in $JAVA_HOME/jre/lib/ext and it works fine.
    If you copied the org subsubdirectory and all of it's contents to C:\MySQL\mm.MySQL-2.0.14, then use that as your classpath.
    If you're trying to use just the jar file, then the classpath entry should be the directory that contains the jar.
    Because you don't have C:\mysql\bin in your PATH, you either have to be in that directory or prepend your sql commands with C:\mysql\bin for the commands to be recognized.

  • Loading Java Applet

    I have a Java file (.jar) that runs fine on my desktop, but when I add it to my files in Dreamweaver and try to run it, it gives me this error:
    "Could not find the main class: C:\... Program will exit."
    Further, once I upload it online and click on it after it says it has an error, it spits this out:
    load: class teatApp.jar not found.
    java.lang.ClassNotFoundException: teatApp.jar
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Exception: java.lang.ClassNotFoundException: teatApp.jar
    [Updated on: Sat, 08 October 2011 19:39
    I'm using Eclipse to create these .jars and have tried both runnable .jars created from JFrames and .jars created from applets (these don't run on the desktop but do run within Eclipse), but both give me the same error stated above.
    Any help to find a solution for my problem would be greatly appreciated!

    This is a Java programming question and not a Dreamweaver question. It appears your Java app requires a class file that's found on your local hard drive. I don't know Java but it seems like to get around this problem you need to ensure that the required class file is compiled and included in the final Java "binary" (.jar) file that will be served up.

  • Read binary files that are wraped in the downloaded executable signed jar

    Hello, there:
    I have created a Swing application and created a signed jar file and uploaded it to my site. The signed jar includes class packages, and a folder of binary files which are the datasource for my application.
    jws downloads this signed executable jar, it'll automatically run it, but it has problems reading the binary folders wrapped in itself (the app is supposed to read the folder's structure and use the info to create a JTree object, and read the file's content as well). Is it the file path conversion problem? Do we need to use URL instead? I tried it after reading some threads on this forum but didn't make it.
    As an alternatives, I want JWS to unjar the jar file and expand it to exploded files. I manually unjar it and run the app from command line, it works fine.
    Plus, the app is supposed to manipulate the binary files when it's in process, like saving new content back to the files, zip the files and upload them to the remote sql server. therefore, I think it's easy to have it run when it's expanded.
    So here is the question: JWS by default is running the executable jar, is there a way to tell JWS to unzip the jar and find the main class in the exploded files and run it?
    Thanks a lot for your suggestions,
    Sway

    You can get to any resource in a jar file in your classpath. The code below will return InputStream for resource.bin nested two packages down.
    InputStream in = YourClass.class.getResourceAsStream("/com/mypackage/resouce.bin");  //use '/' instead of '.'You can open a FileOutputStream to write that file.
    OutputStream out = new FileOutputStream("myTempResource.bin");
    IOUtil.streamAndClose(in,out);If the resouce is a nested zip or nested jar then you can use the Java Zip utilities to unwrap the stream.

  • [svn:fx-trunk] 11488: Resubmitting binary distribution of xercesPatch. jar from the third party module in the SDK and compiled it with Sun JDK 1.4 .2_12.

    Revision: 11488
    Author:   [email protected]
    Date:     2009-11-05 17:10:10 -0800 (Thu, 05 Nov 2009)
    Log Message:
    Resubmitting binary distribution of xercesPatch.jar from the third party module in the SDK and compiled it with Sun JDK 1.4.2_12.
    QE notes: N/A
    Doc notes: N/A
    Bugs:
    SDK-16818 - Must open-source the code for xercesPatch.jar.
    Reviewer: Discussed with Gordon
    Tests run: Checkintests
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-16818
    Modified Paths:
        flex/sdk/trunk/lib/xercesPatch.jar
        flex/sdk/trunk/modules/thirdparty/xerces-patch/build.xml

    Did you try this:
    http://forum.java.sun.com/thread.jsp?thread=434718&forum=60&message=1964421

  • Help:how to use java.util.jar to zip or unzip a binary file.

    how to use java.util.jar to zip or unzip a binary file or a file contain native code.

    It may help you to know how I add JARs
    1. I open my Project (myProject)
    2. I Mount the JAR to the FileSystem (like mypackages.jar = which includes com.mus.de.myClass.java)
    3. I Mount the File to the FileSystem (like c:\..myfiles..\myProject)
    3.1 I add the File to my Project
    4. I select File | New -> Classes | Main
    4.1 I typed "import com.mus.de.myClass.java" to refer to this package.
    4.2 I called some of the public methods
    thats it
    Andreas

  • Check binary compatibility between 2 Jars

    Hello,
    we have a Java API to our repository product. Is there a way to check binary compatibility between different versions of that API? The problem is that the interfaces evolve and sometimes changes are necessary. So we already had the problem that different versions are incompatible.
    I found just one tool: japitool. But it does not detect the latest problem we have.
    Thanks in advance
    Torsten

    I mean the facts and rules described in chapter 13 of the Java language specification (Binary Compatibility; http://java.sun.com/docs/books/jls/second_edition/html/binaryComp.doc.html#44872).
    Torsten

  • Understanding Java Binary Incompatibility

    Hi folks,
    I'm just reading up about binary imcompatibility for a software engineering exam and having a hard time understanding the notes. Is anyone able to provide an understandable definition. I understand that the problem comes from having different classes at compile time than at runtime, but I'm trying to understand why this affects Java and not other languages, such as C.
    any input is much appreciated

    the simplest example I can think of is when a class changes its interface between versions. so you have
    1) MyClass.java is compiled to MyClass.class with a public method a()
    2) Client.java is compiled to Client.class that calls method a()
    3) MyClass.java is recompiled without Client.java present, having removed a() and replaced it by b()
    4) Client.class is run, the new MyClass.class is loaded and the JVM detects that a() is not found in MyClass.class's definition. This is not necessarily reported until Client attempts to call a()
    http://java.sun.com/docs/books/jls/second_edition/html/binaryComp.doc.html#44952
    asjf

  • Error while deploying a JAR-File into 8i !

    Hello to all Oracle experts,
    At the attempt to deploy a Jar file into the 8i the following
    error message comes onto Shell level:
    initialization complete
    loading : com/sun/xml/tree/XmlDocumentBuilder
    ORA-01536: space quota exceeded for tablespace 'PROCON_DATA'
    Error while loading com/sun/xml/tree/XmlDocumentBuilder
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at "SYS.DBMS_LOB", line 700
    ORA-06512: at "PROCON.LOADLOBS", line 1
    ORA-06512: at line 1
    creating : com/sun/xml/tree/XmlDocumentBuilder
    Error while creating class com/sun/xml/tree/XmlDocumentBuilder
    ORA-29509: incorrectly formed Java binary class definition
    The command was:
    loadjava -user procon/procon@t2srv1:1521:PROCON -thin -verbose -schema PROCON xml_un.jar
    It would please me if somebody has an idea to this error !
    null

    Hi Olivier,
    you could try the following approach:
    1. Package your JAR files as J2EE Engine libraries and deploy them on it as described here: <a href="http://help.sap.com/saphelp_nw04/helpdata/en/9f/2ade3fc6c6ec06e10000000a1550b0/frameset.htm">Working with J2EE Libraries</a>.
    2. Set reference to this library from the application that use them. Depending on your application, refer to the appropriate documentation:
    -- reference from a J2EE app -> see <a href="http://help.sap.com/saphelp_nw04/helpdata/en/15/d5d93fe80fed06e10000000a1550b0/frameset.htm">Referencing Libraries in Applications</a>
    -- reference from a portal app -> see <a href="http://help.sap.com/saphelp_nw04/helpdata/en/02/788540ae1dbb4de10000000a1550b0/frameset.htm">Referencing Elements</a>
    Hope that helps!

  • Using a JAR file as a project file

    My application allows the user to create projects. Previously, a project file was simply an XML file. Now, a project file needs to also contain many images.
    I thought it would be a good idea to simply use a JAR file as my project file.
    Since I've really never really worked with JAR files and the java.util.Jar package directly, I have a few questions.
    1) Would it be better just to simply store the images as binary in the XML file? I just spent a good amount of time making the XML file very readable so I thought it would be better to keep the images separate while still having a single "project" file.
    2) Is there anything inherently wrong with the way I'm working with the JAR file in the code below?
    Simple XML file:
    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE project [
      <!ELEMENT project (img+)>
      <!ELEMENT img EMPTY>
      <!ATTLIST img src CDATA #REQUIRED>
    ]>
    <project>
         <img src="blah.jpg"/>
    </project>
    import java.io.*;
    import java.util.jar.JarFile;
    import javax.xml.parsers.*;
    import org.xml.sax.*;
    import org.xml.sax.helpers.DefaultHandler;
    public class LoaderTest {
        private String imageName;
        public LoaderTest() {
            InputStream i = null;
            JarFile jf = null;
            try {
                jf = new JarFile("project.jar");
                i = jf.getInputStream(jf.getJarEntry("project.xml"));
                // Here's my simple XML parser to load the project and images
                SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
                parser.parse(new InputSource(i), new DefaultHandler() {
                    @Override
                    public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
                        // Right now we only care about images
                        if (qName.equalsIgnoreCase("img")) {
                            imageName = attributes.getValue("src");
                // Load the image from the inputstream
                java.awt.image.BufferedImage img = javax.imageio.ImageIO.read(jf.getInputStream(jf.getJarEntry(imageName)));
                // Display the image in a JFrame
                javax.swing.JFrame f = new javax.swing.JFrame();
                f.setLayout(new java.awt.BorderLayout());
                f.setSize(800, 600);
                f.getContentPane().add(new javax.swing.JLabel(new javax.swing.ImageIcon(img)), java.awt.BorderLayout.CENTER);
                f.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
                f.setVisible(true);
            } catch (ParserConfigurationException ex) {
                ex.printStackTrace();
            } catch (SAXException ex) {
                ex.printStackTrace();
            } catch (IOException ex) {
                ex.printStackTrace();
            } finally {
                // Do our best to close the input streams
                if (i != null) {
                    try {
                        i.close();
                    } catch (IOException ex) {}
                if (jf != null) {
                    try {
                        jf.close();
                    } catch (IOException ex) {}
        public static void main(String[] args) {
            new LoaderTest();
    }Thank you!

    1) I also think it's much better to keep your images separate from your XML, this prevents a lot of in case you just want to read XML data
    2) What's exactly going wrong here? For the project.xml, make sure it's not inside a directory within the JAR file, or else the variable i will be null. Otherwise it looks fine..

Maybe you are looking for