Jar file won't execute

I have written a program to manipulate an access database, it works fine from Eclipse but when I create a jar file using Jarbuilder 0.8, this jar file wont execute. It returns
Exception in thread "main" java.io.IOException: invalid header field
at java.util.jar.attributes.read(Unknown Source)
at java.util.jar.Manifest.read(Unknown Source)
at java.util.jar.Manifest.<init>(Unknown Source)
at java.util.jar.Jarfile.getManifest(Unknown Source)
The whole set of classes is online together with the database at users.skynet.be/NewOne/Televisie.rar (with Hoofdvenster as Manifest)
and the jar file at
users.skynet.be/NewOne/Televisie.jar
I was wondering, do I have to include anything special because i m working with an ODBC here, or what else could be the problem ?
All comments and suggestions are welcome, thnx in adance !!

Hi there!
After a brief look at your manifest a saw that you specifie the path to your main-class like this:
Main-Class: gui/Gui
...and when you make the jar-file you type:
jar cmf Manifest.txt JAppointment.jar Gui/*.class ...etc..
Remember that Java is case-sensitive and look at "gui" and "Gui" differently!
Maybee that could be the problem?
/Andrew

Similar Messages

  • Jar files won't execute

    "Could not find the main class. Program will exit!"
    no matter what i put in the manifest, i keeps saying that,
    i've read everything i could find at jar files, and nothing works

    Have you put Main-class attribute in manifest file ?
    if yes, did you put a new line after this attribute ?

  • 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?

  • Captivate 3 Published file won't execute JavaScript

    Pulbished Captivate 3 course.   Final screen has an exit button with the following script:  ab_SetScoreStatus(100,'completed');ab_CloseWindow();       When I post the course to our LMS it uploads fine, but when I try and run the course I get an error when I click on the Exit button and it doesn't do anything.   I had someone try the same thing on their computer and it works fine for them so I'm thinking it's something with my settings.   This used to work for me but then I got a new computer so not sure if the settings (IE, Flash or ????) are different or what.   I'm running Flash 10, and IE 8.   Any help would be greatly appreciated.  Thank you.

    Good morning Rick, and thank you for trying to help.
    Sheri Delaney
    From: Captiv8r [email protected]
    Sent: Wednesday, February 16, 2011 3:59 PM
    To: Delaney, Sheri
    Subject: Captivate 3 Published file won't execute JavaScript
    Welcome to our community
    See if the following links help.
    http://forums.adobe.com/thread/473021#5
    http://forums.adobe.com/thread/473021#10
    Cheers... Rick
    http://www.robowizard.com/pc.gif
    Helpful and Handy Links
    http://www.Adobe.com/cfusion/mmform/index.cfm?name=wishform&product=5
    http://www.ShowMeSolutions.biz
    http://sorcererstone.wordpress.com/
    http://www.gooberguides.com

  • Jar file is not executing

    hi all,
    i was creating a jar excutable, when i was trying to execute it by double clicking on it(its placed in the desktop), open with dialog box is coming. could u plz help me out??
    here what i've done.. in the manifest file i've entered
    Manifest-Version: 1.0
    Main-Class: Class2Jarand to create the jar file i've given the command
    jar cmf manifest.mf max.jar Class2Jar.classthankx & regards,
    max

    open with dialog box is comingLooks like a broken file association. Try re-installing the Java runtime to have Jars associated to it again.

  • Java Malfunction in Mac OSX 10.5 - .jar files won't open

    All of a sudden none of my .jar files will open (most importantly the dimsum.jar which I use almost everyday). I have run a clean up of my cache and tried everything I can think of to bring back the .jar operations and nothing works as it did before. Upon attempting to open the file my Console messages consist of a huge list of font names something like (0x0-0x233233.com.apple.JarLauncher1561 Type: TONES Name: ZoobeSSK-BoldItalic) and I get a loading window that freezes never leads to the main program.
    I had this problem before and I simply rearranged my Java preferences so the 32-bit J2SE 5.0 was at the top of the list and it solved the issue but this time it didn't work. Right now my Java Applications list order is like this
    J2SE 5.0 32-bit
    Java SE 6 64-bit
    J2SE 1.4.2 32-bit
    J2SE 5.0 64-bit
    Being that I am not an official "developer" and that I only basically know my way around OSX, I thought maybe I could skirt the problem by changing my .jar file into an .app and skip the Java console all together. So I DL'd jarbundler which it turns out is also a .jar file and it won't open either. I simply get a message saying "The Java JAR file "jarbundler 2.1.0.jar" could not be launched."
    Here is the Console message when I attempt to open Jarbundler.jar if this helps:
    10-1-28 上午07:34:44 0x0-0x503503.com.apple.JarLauncher3309 SystemFlippers: didn't consume all data for long ID 0 (pBase = 0x100142770, p = 0x100142774, pEnd = 0x100142778)
    10-1-28 上午07:34:44 0x0-0x503503.com.apple.JarLauncher3309 SystemFlippers: didn't consume all data for long ID 0 (pBase = 0x10012d530, p = 0x10012d534, pEnd = 0x10012d538)
    10-1-28 上午07:34:44 0x0-0x503503.com.apple.JarLauncher3309 Failed to load Main-Class manifest attribute from
    10-1-28 上午07:34:44 0x0-0x503503.com.apple.JarLauncher3309 /Users/XIV/Desktop/jarbundler-2.1.0/jarbundler-2.1.0.jar
    Can anyone PLEASE suggest a solution? Or a reason as to why this might have happened when it was working fine a month ago and how to prevent this from happening again?
    Thanks in Advance

    Recently nothing has really changed... I tried reinstalling my stock fonts and that didn't help. The programs that aren't working are Dimsum (http://www.mandarintools.com/dimsum.html) and Jar Bundler that comes with the Apple's free Xcode Developer Tools. I thought if I could get Jar Bundler to work I could turn Dimsum into an app and dodge the problem altogether, but that didn't work either... My Java is updated (according to my computers Software Update window) and everything else seems to be working fine... I hope it doesn't turn into a system reinstall...

  • Jar file doesn't execute correctly

    I have created a jar file both manually and using Eclipse. I seem to run into the same strange issue however.
    When I run the jar file from the command line, it executes some of the code, however, it doesn't seem to run any code in one of my classes. The program doesn't fail, however, and doesn't give me any exception.
    When I extracted the .class files in the .jar, my class is there. The decompiled code is also the same as I had written. When I execute the class file in the command prompt, everything works fine.
    Has anyone seen anything like this before?

    if you have problem to make a jar and you dosent understund what to do i have made a special program for you. in the beginning it was just for myself byt you lookslike you chould need it. www.tiinusen.hello.to/download/ just download jar converter there is a explanation/readme when you zip it up.

  • Wrapping Jar Files in Linux Executables?

    I was wondering how to wrap my Jar file in a Linux Executable. I tried dowloading Launch4j, but that only allowed Windows Executables. Is there an easy way to do this? I'm trying need to be able to pass arguments to the Jar file.
    Thanks!

    And the arguments vary each time the user use your application ?
    Then you will have to write a small shell script which takes the user input, e.g. myShellScript.sh var1 var2 ...
    Inside the script you place the java -jar myProg call and pass the arguments to it:
    cd /path/to/jar
    java -jar myProg $1 $2
    whereas $1 $2 ... holds the argument(s) which you have passed to myShellScript.sh.
    To make it a little bit more comfortable you can define an alias for you myShellScript.sh so there is no need that myShellScript.sh is in /usr/bin,
    Is it that what you are looking for?
    Edited by: Michael_Knight on 17.11.2008 08:26
    I just recognized that you use a debian package ... probably you can ignore my last hint.

  • Jar file won't run

    Why is it that whenever i run my program using eclipse it works fine but whenever i export a jar file of it, it doesn't run at all?
    It does not even give an error message and this happens for only one specific class, all the others expoort perfectly

    Probably either 1) the jar file is not located where it should be, or 2) the jar file does not have (or it's incorrect) a manifest file.
    Since you don't give any useful diagnostic information, hard to tell more.

  • JAR file won't HTTP Upload

    I've set up an JavaScript-validated HTML form on CodeTree.org that accepts multiple file uploads: a jpeg, a zip file, and a JAR or SWF file. When site users attempt to upload the JAR file in Safari, it doesn't always work, yet the JPEG and ZIP always upload fine. Does anyone have an idea as to why this occurs? This isn't a problem with Firefox or IE6 PC, and I've written a pretty thorough checker in my PHP5 class.

    Hi there!
    After a brief look at your manifest a saw that you specifie the path to your main-class like this:
    Main-Class: gui/Gui
    ...and when you make the jar-file you type:
    jar cmf Manifest.txt JAppointment.jar Gui/*.class ...etc..
    Remember that Java is case-sensitive and look at "gui" and "Gui" differently!
    Maybee that could be the problem?
    /Andrew

  • Signed JAR file won�t work on A Mac

    Hello I am trying to run this java script on a Mac
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import javax.swing.table.*;
    import java.io.*;
    public class Applet1 extends Applet {
    private FlowLayout flowLayout1 = new FlowLayout();
    private JFileChooser jFileChooser1 = new JFileChooser();
    public Applet1() {
    try {
    jbInit();
    catch(Exception e) {
    e.printStackTrace();
    private void jbInit() throws Exception {
    this.setLayout(flowLayout1);
    this.add(jFileChooser1, null);
    The signed jar works properly on pc and it doesn�t work on a Mac.
    I am using JDK 2.5 and swing 1.1.1

    What error are you getting?Swing: checked access to system event queue.
    An exception occurred:
    com.apple.mrj.JManager.JMAppletSecurityExc: security.checkread: /, /
         at com.apple.mrj.JManager.JMAppletSecurityOld.checkRead(JMAppletSecurityOld.java)
         at com.apple.mrj.JManager.JMAppletSecurityOld.checkRead(JMAppletSecurityOld.java)
         at java.io.File.exists(File.java)
         at javax.swing.filechooser.UnixFileSystemView.getRoots(FileSystemView.java:270)
         at javax.swing.plaf.metal.MetalFileChooserUI$DirectoryComboBoxModel.<init>(MetalFileChooserUI.java:683)
         at javax.swing.plaf.metal.MetalFileChooserUI.createDirectoryComboBoxModel(MetalFileChooserUI.java:666)
         at javax.swing.plaf.metal.MetalFileChooserUI.installComponents(MetalFileChooserUI.java:145)
         at javax.swing.plaf.basic.BasicFileChooserUI.installUI(BasicFileChooserUI.java:106)
         at javax.swing.JComponent.setUI(JComponent.java:258)
         at javax.swing.JFileChooser.updateUI(JFileChooser.java:1296)
         at javax.swing.JFileChooser.setup(JFileChooser.java:294)
         at javax.swing.JFileChooser.<init>(JFileChooser.java:270)
         at javax.swing.JFileChooser.<init>(JFileChooser.java:233)
         at Applet1.<init>(Applet1.java:13)
         at com.apple.mrj.JManager.JMAppletViewer_OLD.doLoadCode(JMAppletViewerOld.java)
         at com.apple.mrj.JManager.JMAppletViewer_OLD.setState(JMAppletViewerOld.java)
         at com.apple.mrj.JManager.JMViewerEvent.post(JMAppletViewerOld.java)
         at com.apple.mrj.JManager.AVDispatcherThread.run(JMAppletViewerOld.java)

  • How to execute a jar file which has an applet, without using a html file ?

    I have a jar file which contains a set of class files. iam able to execute the jar file by using this html code
    <html>
    <applet code="file.class" archive="file.jar" width="500" height="300">
    <param name="name" value="value">
    </applet>
    </html>
    I want to know how to execute this class file without using the html tags.
    pls help me out in this.
    Anki

    Hi,
    You can make an executable jar file such that when you double click on that it starts running. Just follow the steps.
    1. Open a notepad and write the following
    Main-Class: XXXXXXXX
    XXXXXXX means Your Main Class name. Don't forget to press Enter after you write your class name.
    2. Save the file as Mani.mf
    3. In the commant prompt ( your directory ) type following lines.
    jar cmf Mani.mf Demo.jar *.*
    4. This will make a jar file which is executable jar file
    Hope this will help you.
    Deepak

  • Why -jar option used to install a software which is in executable jar file?

    Hi all,
    i have a query, i have a generic installer which is used to install the oracle weblogic 10.3 software in unix platform(i.e., which is in .jar extension) which is executable jar file.
    To install this software which have to use -jar option to install
    java -jar net_server<version>_generic.jar
    my question that why we use -jar option to install or to extract the software
    can any one clarify my doubt...
    thanks in advance
    abhi
    Edited by: sumanth_abhi on Jan 27, 2009 11:50 PM

    According to the Jar Guide (http://java.sun.com/j2se/1.4.2/docs/guide/jar/jarGuide.html)
    Executable Jar Files
    On Microsoft Windows systems, the Java 2 Runtime Environment's installation program will register a default association for Jar files so that double-clicking a Jar file on the desktop will automatically run it with javaw -jar. Dependent extensions bundled with the application will also be loaded automatically. This feature makes the end-user runtime environment easier to use on Microsoft Windows systems.
    The Solaris 2.6 kernel has already been extended to recognize the special "magic" number that identifies a Jar file, and to invoke java -jar on such a Jar file as if it were a native Solaris executable. A application packaged in a Jar file can thus be executed directly from the command line or by clicking an icon on the CDE desktop.
    Despite that every JAR file can be executed as a program if and only if the META-INF/Manifest.mf contains the Main-Class tag. This done through java -jar jarfile.jar
    --olaf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Deploying Java Desktop App using executable JAR files

    Hi there.
    Today I am very optimistic about java. I am a beginner, and I had tried (in my few free time) to understand how to deploy java desktop apps.
    I am using the lattest NetBeans IDE to do the programming and it is very very fast and optimized.
    Going to the point, I tried some time ago to deploy an application (made with this IDE) using JAR files, but even though the application run well on my IDE, when I packed it, it rised an error saying that
    java.lang.NoClassDefFoundError: org/netbeans/lib/awtextra/AbsoluteLayout
    I was using an absolute layout on my JFrame forms and this AbsoluteLayout is provided by netbeans and not by the normal SDK.
    I then looked for the absolute layout class and found a jar file in the following path:
    C:\netbeans\modules\ext\AbsoluteLayout.jar
    So I mounted the Jar file in my File Systems and then added the contents of the file to myApp.Jar file.
    I used the automated Jar Recipe Packaging feature of netbeans, that is why I needed to mount the AbsoluteLayout.jar file into my file systems.
    Now it runs fine by just right clicking the MyApp.jar file from Windows Explorer.
    In a next reply to this topic I will include some sample code so that anybody requiring to do such implementation can take this for help.
    Regards!
    JN

    Well,
    I will take some time here to show the basic source code and procedure to create a desktop application, pack it up in a Jar file for deployment, add other classes or jars to the deployment jar file and finally open the jar file as an executable. This applies for either windows and linux environments.
    Take in count i am using Netbeans IDE 3.x (3.5)
    First I open the IDE and create a new project called MyDesktopApp. This is done by going to the menu Project / Project Manager. Then click on the New button and specify the project name and click on OK.
    At this point, the Filesystems tab in the project explorer is empty. So I mount a directory to store myDesktopApp in it. I selected c:\MyDesktopApp but you can select any name you want.
    To mount the directory you follow these steps:
    1. Right-click on File Systems
    2. From the contextual menu select Mount > Local Directory
    3. In the filechooser window, you just browse it and SELECT the directory to mount. Be aware that you can even create the directory on this window. Do not enter (double-click) into the directory you want to mount, just select it and click on finish...
    4.Then the directory entry appears under the filesystems node of the project explorer.
    Now you have to create your application. You can either create a package (special configured and tracked directory) or you can create the clases directly inside the directory. For tidy project, I will create the package.
    To create the package follow these instructions:
    1. Right-click on the mounted directory and from the contextual menu select New > Java Package
    2. In the New Wizard - Java Package window, type the package name and click on finish. I use the "MyDesktopApp" as package name.
    OK. Now the package is created under the mounted directory. Now we have to create the Main Class. In this case I will use a JFRAME as the main class but you can create any class you want.
    To create the JFRAME as main class follow these steps:
    1. Right click on the java package you just created and select New>JFRAME from the contextual menu. If you do not see the JFRAME option on the NEW sub menu you will have to select the All Templates option. I explain the All Templates option now on, it will be easier to use the JFRAME if available. Once you use JFRAME with the all templates then the JFRAME will show up in further NEW usage.
    2. So finally we used the All Templates, and you select the Java GUI Forms > JFRAME form option and click on NEXT.
    3. Give it a name. (I used MyDesktopAppFrm) and click on finish. Be aware you can set advanced options by clicking on next. But for the purposes of this topic we will use default options so click on FINISH
    4. A new JFRAME form appears inside your package. Right click on the form and select Set layout > Absolute Layout.
    5. Add some controls and code. I added a label and a button. And coded the ActionPerformed event of the button to say hello! on the label. this is up to you. The code just looks as follows:
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    // Add your handling code here:
    jLabel1.setText("Hello folks!");
    6. Compile and execute the form.
    Let's say this is our Desktop Application. Now We will pack it in a Jar in two steps...
    A. Create a JAR file (Recipe)
    1. Right-click on your package and select New > All Tempaltes (Long Route) You can also select New > JAR Recipe if available.
    2. On the New Wizard Window, choose the JAR ARchives > JAR Recipe template and click on NEXT
    3. I used MyDesktopApp as the file name and Defaults and then click on Next.
    4. Specify the JAR Contents. Select the Package (not the mounted folder) from the mounted file system and click on add and then click on NEXT twice...
    5. On the JAR Manifest window, click on GENERATE
    6. Edit the manifest in the window to add the following code:
    Main-Class: MyDesktopApp.MyDesktopAppFrm
    7. Ensure the Main-Class definition is the same as your java package and JFRAME name. Click on FINISH
    8. At this point we have a jar file in your project directory but this file wont run because it is missing some Netbeans clases that we will add in the next set of steps... Just to check, compile the file (right click on the JAR file and compile) and try to execute. It must compile but must not execute.(well if it executes you are done. It may execute if you did not set the lay out of the form as AbsoluteLayout)
    B. Add the AbsoluteLayOut to the JAR
    1. Right click on File Systems and select Mount > Archive Files
    2. Look for your netbeans installation folder and select the following file:
    .../netbeans/modules/ext/AbsoluteLayout.jar
    3. Click on finish
    4. Now the JAR File is mounted in the file systems.
    5. Right-click on your MyDesktopApp.JAR file and select properties.
    6. Look for the contents property click once on it and then on its elipsis button [...]
    7. From the FileSystems box in the Contents window, select the AbsoluteLayOut file and click on Add
    8. Then the system asks you if you are sure. Of course you are so click OK. (If not sure, just read the message text and click OK...:-))
    9. Click on OK
    10. Compile your JAR Recipe (right click on it and Compile)
    11. Now you must be able to run the file by right clicking it and EXECUTE.
    12. Also you must be able to run the file by double clicking the file from a Windows Explorer. You may receive a message asking to select the program to run the file with. You must browse and select the Javaw.exe file in the bin directory of your Java RUn Time installation. This is typically located at C:\j2sdk1.4.0_01\jre\bin or something like that. Use the File-Search feature of window to locate the JAVAW.exe file if needed.
    I hope this long explanation helps somebody to deploy Java Desktop applications. Please reply the message if it helps you just to know it was useful.
    Thanks for your time....
    JN

  • Problem in executing jar file

    Hello,
    I have created jar file. after it is double-clicked, the menu form is coming and it is executing correctly. the problem is reading from database but not writing to it. it is now displaying any error msg. y it is happening?
    i am havng database in the same directory where my jar file is.
    Thanks,
    Sri

    maybe you have made an error in the code for reading. execute the jar with the command line: java -jar <jar-file> and then execute the operation. if there is an error it display to you

Maybe you are looking for

  • Multiple files with the same file name within the same folder

    It looks like a finder bug. To replicate, I surf to any website, I right-click on a jpg image, select "Save Image As" and in the window that pops up I type in the filename "000.jpg", I select the folder Pictures, and click on Save. BTW, I don't know

  • Disc burner and software not found

    i have this problem after updating itunes. i had demon tools, but i uninstalled it. i also turn on my cd/dvd burner on from power save mode. it still says the same error. how do i fix it?

  • CTI OS Client Calltype

    . When I  am geting call on CTI OS agent desktop, the caltype is appearing as PREROUTE_ACD_IN instead of the last calltype used by the script. I have different calltype for each cuctomer option. I was expecting this same calltype will appear on callt

  • Downloading trial error.

    Exit Code: 6 Please see specific errors and warnings below for troubleshooting. For example,  ERROR: DW050 ...   -------------------------------------- Summary --------------------------------------  - 0 fatal error(s), 5 error(s), 0 warning(s)    --

  • Error in Cloning R12 appsTier in Sun Solaris 10

    Hi While cloning R12 Instance for apps tier I get the error like AutoConfig could not successfully execute the following scripts: Directory: /base/SID/apps/tech_st/10.1.3/perl/bin/perl -I /base/SID/apps/tech_st/10.1.3/perl/lib/5.8.3 -I /base/SID/apps