While executing a jar file I am getting an error

while exec a jar file i am getting an error
invalid file (bad magic number): Exec format error
i tried to execute it with the commnad
java -jar test.jar
or by directly too
./test.jar

Than tell me how to launch a jar file I tried different ways like
java -jar MyJar.jar
and
MyJar
and
./MyJar
but its not worked

Similar Messages

  • Exception is thrown only while executing the jar file

    java.lang.NoClassDefFoundError: javax/mail/Address Exception is thrown only while executing the jar file. But the program compiles and executes good when executed for command prompt through the class files.
    I used javamail API in my program. Classpath and every others are set to the right one's. Executed fine when used java Random.class. But the problem is only with the jar file.
    Please help me out in this regard. Why the exception is thrown only in jar but not at class level.

    Assuming you're running your program using "java -jar", your jar file needs a Class-Path entry
    in the manifest file that references mail.jar.

  • When i executed this class file  i am getting runtime errors

    when i executed this class file i am getting runtime errors
    code is :
    import java.awt.event.*;
    import java.awt.*;
    public class Test extends Frame
    java.awt.Window w;
         TextField t;
         Test()
         t=new TextField(20);
         add(t);
         addWindowListener(new WindowAdapter()
                             public void windowDeactivated(WindowEvent ev)                               {                    
                                  w.toFront();          
                                  System.out.println("hai");
         setSize(300,300);
         setVisible(true);
    public static void main(String args[])
    Test t =new Test();
    after executing that class i am getting this errors
    Exception occurred during event dispatching:
    java.lang.NullPointerException:
    at WindowEventDemo.windowActivated(WindowEventDemo.java:76)
    at java.awt.Window.processWindowEvent(Window.java:612)
    at java.awt.Window.processEvent(Window.java:576)
    at java.awt.Component.dispatchEventImpl(Compiled Code)
    at java.awt.Container.dispatchEventImpl(Compiled Code)
    at java.awt.Window.dispatchEventImpl(Compiled Code)
    at java.awt.Component.dispatchEvent(Compiled Code)
    at java.awt.EventQueue.dispatchEvent(Compiled Code)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:68)
    if anybody know how to pls help me

    You are using w that you have not done anything with.
    Add following code to the begining of your cinstructor:
    w = this;
    Then it should work.
    //Anders ;-D

  • IN SE78 : WHILE UPLOADING THE TIF FILE I AM GETTING THE ERROR

    Hi ,
    While uploading the drawing in se78 . iam getting the errror
    "erroneous tif formate"
    . PLz help me to upload the tif file  thro se78.
    even i removed the compression check box ,.
    Thanks,
    Rani

    Hi
    You can upload logo using SE78 or using program RSTXLDMC
    or by using OAER
    Steps for uploading Logo :-:
    1. Goto the transaction OAER
    2. Enter the class name as 'PICTURES'
    3. Enter the class type as 'OT'
    4. Enter the object key as the name of the logo you
    wish to give
    5. Execute
    6. Then in the new screen select Standard doc. types
    in bottom window
    Click on the Screen icon
    Now, it will ask for the file path where you have
    to upload the logo
    7. Now you can use this logo
    To create a logo in SAP printouts just do the following
    1. Save a Logo using Imaging, Paint shop Pro or Corel Draw as Tiff file.
    2. Run program RSTXLDMC and enter the following parameters
    Enter file name C:\COMPLOGO.TIF
    UOM CM
    Line width for text 132
    Text name ZHEX-MACRO-COMPLOGO
    Text ID ST
    Text language = E
    Number of Tiff gray levels (2,4,9) 2
    3. Then Create a new window 'COMP' with attributes;
    Window COMP description Company Logo
    Left margin 7.00 CH window width 10.00 CH
    Upper margin LN window height 8.00 LN
    Finally in the text element, mention
    /: INCLUDE 'ZHEX-MACRO-COMPLOGO' OBJECT TEXT ID ST LANGUAGE 'E'.
    Please note that if object name is not indicated as 'ZHEX...’ the logo may not be printed!
    You will not be able to see the logo in a test print. The same will be printed in actual printout.
    SMARTFORM
    1) In Smart Forms Editor, In left pane, right Click any Page (say Page1) and select Create -> Window, Give it a name and Description (Say Window1)
    2) Right Click on Window (Window 1) and select Create -> Graphics, Give it a name and description
    3) In general Attributes, Select Name, get search help (F4) , you will find a list of pictures
    4) Select any picture and set its Resolution in DPI
    5) Press F9 to open Smart Forms Builder, Select window (Window1) and In Output options window set, size and position of the Logo
    6) Set any other parameters if required, save and activate.
    7) If there is only 1 Window in the forms, set it as Main Window in general attributes.
    8) Use TCode SE78 to upload new pictures and logos.
    look at Thread Dynamic Graph in smartforms
    Refer the links also -
    Re: Dinamic Graph in smartforms
    How to get file perperties in Unix server
    Regards
    Selvapandian Arunachalam

  • Program not executing in jar file. Help please.

    I went through the tutorial about jars on the sun website and i created a jar file with a hello world program like this:
    "cd E:\Batch
    jar cfm test.jar m.txt test.class
    PAUSE"
    My m.txt contains this text:
    "Main-Class: test.class"
    The jar file is created. No errors.
    Then i try and run the jar with this:
    "cd E:\Batch
    java -jar test.jar
    PAUSE"
    I get "NoClassDefFoundError: test/class"
    All the dos command are run form batch files and everything is in the same directory.
    I've searched around google and this website for answers but i have failed to find anything.
    Does anyone have any suggestions i can try to fix this? I've ran out of ideas.

    Ah thats what the problem was. That was driving me
    mad thanks. So whatever you put in a jar file must be
    in a package or you can't run it.
    Message was edited by:
    JahvahNo. You can also not put it in a package, but when you specify the main-class attribute in the manifest file, be sure that you don't tell it that it is in a package.

  • 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

  • How to execute a jar file in a java application

    Hi,
    I've already try to execute a jar file by this way :
    Runtime.getRuntime().exec(java -jar myJarFile.jar);
    But the problem is that the display doesn't launch. Normally a "JFrame" display.
    however the corresponding process is launched.
    So i would to know if there is a way to execute a Jar File without using the Runtime class.
    Is there a specific class for the Jar File?
    Thank you.
    Richard

    Create a 'manifest' file pointing to the 'main' class, jar it into the .jar file, place it onto your desktop - or whereever you can click on it, and click on it.

  • How to execute a jar file in other machine?

    Hi all,
    I am working with java. and my machine is connected to LAN.I would like to execute a jar file in my machine from a remote machine that is also connected to LAN.how should i go about doing this.Help me if somebody have a solution as i am badly in need of this.
    Regards,
    Mohan

    Hi Mohan.tkm,
    If you want it to be done in pure Java and independently of the OS of both computers, you may build a RMI server that will launch your JAR by request of a remote RMI client.
    There's an example of RMI here .

  • In LSMW while executing the specify file step logical file name and path.

    Hi ,
    In LSMW , while executing the specify file step, logical file name and path is mandatory field to entry, but in some of other LSMW objects, these fields are not mandatory one, i want to know is it possible for me to do hide the logical file name and path field in specify file step.
    thanks
    Md nisar

    Hi,
    For some Transactions while executing the Specify file step Logical File and Logical Path are mandatory.
    In this case Converted file will be stored in the application server. According to the specified Logical File and Logical path.
    Hope this will help you....
    Regards,
    Tirumala Reddy

  • JAR file does not get uploaded to client for my SERVLET generated APPLET

    Some help please...
    I have a servlet that generates the HTML code that contains an APPLET. This APPLET needs a JAR file that is listed under its ARCHIVE property. The SERVLET is in a JAR file that is in the same directory as the other needed JAR file. If I create a static HTML with the output of the SERVLET it works fine. But if go through Weblogic the needed JAR file does not get uploaded to the client so I get a java.lang.NoClassDefFoundError:and my APPLET does not load.
    Q1: I am not sure what to put under the CODEBASE tag. I tried "." and I also tried "http://mymachine" but both did not work. I also tried without the CODEBASE tag. No luck. The SERVLET is bound to http://mymachine/servlet.
    Q2: Does anyone have any suggestions on how to do this? Is there a way to force the browser to upload a certain JAR file?
    Thanks...

    It works!!
    This is what I did:
    The jar file in question was the weblogic.jar. I tried putting it under the lib directory of my war file but I had problems because the weblogic.jar contains other war files inside so when I tried to deploy my war file it also tried to deploy the inner war files which for some reason did not work. So I tried removing the war files from the weblogic.jar and this time I had no problems deploying my war file but I still could not find the classes I needed. So I tried moving the weblogic.jar to the root dir of my war file and it worked!! Now the trick here was: I did not set the CODEBASE AND I had the ARCHIVE paramenter set in TWO places like below:
    <APPLET CODE = "marketmap.client.MarketMapApplet"
    ARCHIVE = "weblogic.jar"
    WIDTH = "657"
    HEIGHT = "382"
    ALIGN = "BOTTOM"
    ALT = "APPLET tag not recognized">
    </XMP>
    <PARAM NAME = CODE VALUE = "MyApplet" >
    <PARAM NAME = "type" VALUE="application/x-java-applet;version=1.2.2">
    <PARAM NAME = "scriptable" VALUE="false">
    <PARAM NAME = ARCHIVE VALUE="weblogic.jar">
    </APPLET>
    Actually if you do not place a parameter named ARCHIVE (at the end) it wil NOT work. I tried with multiple jar files listed and it works great too.
    Anyway I figure I'd share. Thanks for the help too.
    Lastly for people who choose not to upload the jar files to clients, you should look at the bea documentation on applets. It lists a classpath servlet that allows you to provide classes to the clients without having to force them to download the jar file.

  • Howto execute java jar file via html ?

    hi
    howto execute java jar file via html ?
    could someone pls post a html code ?
    kind regards
    upiter77

    hi
    howto execute java jar file via html ?You can't.
    could someone pls post a html code ?No. you can search for yourself and find the code you need.
    Now, it sounds to me like you're trying to build an Applet or do Web Start or something. In any event, you need...wait for it....Google! :-)

  • While installing the itunes setup i am getting an error"Could not register type library for file ipodsevice.exe" What to do now?

    While installing the itunes setup i am getting an error"Could not register type library for file ipodsevice.exe" What to do now?

    Try posting in the iTunes forum.  You have an iTunes problem not an iPod problem

  • While executing onLoad in Date_before Save.htm, a JavaScript error occurred

    While executing onLoad in Date_before Save.htm, a JavaScript error occurred, I have looked af the Forum and it tells me to delete Program Files\Macromedia\Dreamweaver CS3\Configuration\Commands and I cannot find these files despite searching.
    I had a text conversation with support at Adobe and they no longe support Dreamweaver CS3!  Has anyone else had a similar problem and if so how was it fixed.
    Regards

    Troubleshooting JavaScript errors in Dreamweaver
    http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_19105#dat
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "jockamo" <[email protected]> wrote in
    message
    news:etpo3o$54c$[email protected]..
    >I have set up some pages to have an automatically
    updating "Last Modified
    >On"
    > date. However, I have been getting 2 error dialog boxes
    every time I save
    > a
    > file, both with the same message: "While executing
    onLoad in
    > Date_beforeSave.htm, a javascript error occurred." In
    looking at some
    > other
    > threads on this forum, I have tried deleting the
    Application Data files
    > "Configuration\SiteCache\SEL Web Site.dws" and
    > "Configuration\WinFileCache-####.dat". I have also tried
    several
    > different
    > date formats, but that didn't seem to change anything.
    >
    > I have not been able to find any threads specific to
    this exact error,
    > though.
    >
    > Any help would be highly appreciated! The site is at
    >
    http://picea.sel.uaf.edu/index.html,
    if that helps.
    >
    > Thanks for your help,
    > Jock
    >

  • While dropping the old undo tablespace we get an error

    Hello friends ,
    i Cannot drop old undo tablespace. While dropping the old undo tablespace we get an error
    ERROR at line 1:
    ORA-01548: active rollback segment '_SYSSMU77$' found, terminate dropping
    tablespace
    SQL> select tablespace_name, status, segment_name from dba_rollback_segs where status != 'OFFLINE';
    TABLESPACE_NAME STATUS SEGMENT_NAME
    SYSTEM ONLINE SYSTEM
    APPS_UNDO NEEDS RECOVERY _SYSSMU77$
    Please help
    Thanks
    Edited by: Vicky C on Dec 23, 2012 9:23 AM

    Hi peter
    We not using rman backup only cold backup.. i tried using cold backup in ramn block media recovery but that recovery needs archive log
    RMAN> BLOCKRECOVER DATAFILE 158 BLOCK 48829;
    Starting blockrecover at 18-DEC-12
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=437 devtype=DISK
    channel ORA_DISK_1: restoring block(s) from datafile copy /var/undo/undo02.dbf
    starting media recovery
    media recovery failed
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of blockrecover command at 12/18/2012 16:45:11
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01422: exact fetch returns more than requested number of rows
    ORA-00279: change 5975281035000 generated at 12/08/2012 06:00:58 needed for thread 1
    ORA-00289: suggestion : /prod/archlogs/1_465484_683651989.dbf
    ORA-00280: change 5975281035000 for thread 1 is in sequence #465484
    ORA-00278: log file '/prod/archlogs/1_465484_683651989.dbf' no longer needed for this re covery
    we did not have block media recovery needed archivelog
    Regards
    Vignesh C

  • Error encountered while executing the transform project name.map name. Error:Unable to create the transform. Microsoft.XLANGs.Engine

    Hi All,
    I developed a Biztalk Application aims to upload a flat file data to our system MS SQL Server database. It works fine until one day, an exception is generated as below.
    "Error encountered while executing the transform project name.map name. Error:Unable to create the transform. Microsoft.XLANGs.Engine"
    It continues to generate an exception until I restart the Biztalk instance. And it happens occasionally, no pattern, cannot be traced and debugged.
    Anybody has an idea about this error? Please help, thank you very much.
    The Biztalk Server is running on Hyper-V Virtual machine, Biztalk Server 2009 on Windows Server 2008.
    The Biztalk Application consists of Mapping Functoid, Orchestration, Flatfile Schema, Flatfile Disassembler Pipeline, SQL Send Port, File Receive Port and Send Port
    Eric

    HI Eric,
    I think it might happen because of large message (Out of Memory exception). As you said you have flat file as inbound, you are doing mapping and then sending it to MSSQL
    SO you can check below mentioned things
    1) Any custom pipeline component is used in receive pipeline. (if so optimize the code)
    2) This issue haapen only with large message (BizTalk convert flat file to XMl to if you have 1MB file corresponding XML will be of higher size)
    again all thing mentioned above is assumption.
    YOu can use debugdiag tool to see if memory leak is happening
    http://www.microsoft.com/en-in/download/details.aspx?id=26798

Maybe you are looking for