How to run java jar file

Hello,
I got a java jar file which contains folders with class file. When I double click on the jar file, it gave a error
Exception in thread "main" java.lang.NoClassDefFoundError
How can I run this jar file?
Thanks,
CR

Hello,
I got a java jar file which contains folders with
class file. When I double click on the jar file, it
gave a error
Exception in thread "main"
java.lang.NoClassDefFoundError
How can I run this jar file?
Thanks,
CR... and assuming that Jar contains a manifest file, what does it look like? I would guess that the Main-Class entry is incorrect, or that the Jar has external dependencies to other jars not listed properly in the Class-Path entry.

Similar Messages

  • How to run a JAR file in Unix system?

    hi there
    ca anyone tell me how to run a JAR file in unix system or X window, thank you

    You want to create an executable JAR file? You do it in the following way.
    Create a manifest file such as manif.txt and the contents should contain
    Main-Class: foo
    assuming foo is the name of your main class. Then create the jar as follows
    jar cvfm foo.jar manif.txt foo.class
    I hope that helps you!
    you can find more info here http://java.sun.com/docs/books/tutorial/jar/

  • How to run a jar file

    hi
    can anybody tell me how to run a jar file in java,is there any need to unzip a jar file before running it?
    Thanks in advance.

    Set the classptha, if you want to run it by double clicking.
    I assume that you know, how to set the classpath.I though that if it is an executable jar, the classpath environment variable will be completely ignored. Are you saying something to the contrary?

  • How to run a jar file in JBuilder

    Hi there
    I need to know how to run a jar file using JBuilder. Thanks :)
    Countess

    well i have a german version of jbuilder and there it is under
    experten Archiv-builder
    look at something that has a similar name

  • Help with running java .jar file

    Hi I just installed java with
    # pacman -S jre
    and when i try to run
    java -jar file.jar
    it says command not found. so what do i need to install to be able to run java .jar files through the CLI?

    do, what vintendo says. because it cant find the java in the default paths.

  • How to run a jar file in a browswer?

    Hi, everyone:
    I got a problem here. I would like to run my jar file in a html-based brower, should I write another applet for my jar file? How can I do that? (I don't have applet in my jar file, but only JFrame) Is there any way I can put a runnable jar file into an applet and show on the brower? Could anyone show me how to write this code? Thank you very much!!
    -jxchou

    At first you need a java plug-in for your browser.
    Next you have to implement an applet in your jar-file.
    The tag in your html-document should look like:
    <applet code="Sample.class" archive="sample.jar" width="400" height="400"></applet>

  • How to run my jar file on a webserver

    hello everybody,
    I've created a chat aplication which consists of a client-side and server-side. The client-side is an applet and is working fine. But i'm getting problem with the server-side. Actually, it is working fine on my local system and even in a local area network. But now, i want to put the server-side on a webserver. So, i want to know how can i do that. My server-side is a jar file "chatserver.jar" which i've developed using frame containers. I want to know also how to run the chatserver.jar on the webserver. Is it that i should have implemented jsp? Or javascript? coz my chatserver must be always running 24/7. It must not be available to user. users will chat through applets and the data will be sent to the server-side which will in turn control and recognise those data. Can anyone please help me in that issue.

    that was very kind of u for replying to me. thanks a lot. Well, the web software i'm running is nothing soo great but it's simply a chat server side application. In this application, i'm using a thread where my datagram socket will keep on receiving data from clients and this server side apllication must response to the client. For example, if a client has added a new room, or a new user has logged in, the server side must take care to inform all other clients that a new user has just logged in or a new room has been created. The main method is in the "chatserver.class". Then, i've combined all my classes including the chatserver.class into a jar file. When i click on the jar file on my local system or on the server of a local area network, it works beautifully. So, my server side application works like that. I have to click on the chatserver.jar once and nothing else. No other interaction with the applicaion. But my problem is how to run it on a web-server like apache. Or even if i upload this software on a website, how do i make it run? Shall i implement jsp codes? If yes, how to execute such jar file using jsp?
    here are part of the codes where my datagramsocket is receiving message from clients:
    public void run()
         while(thread!=null)
              byte[] recbuf=new byte[65536];
              recpacket=new DatagramPacket(recbuf,recbuf.length);
              try{
                   servsocket.receive(recpacket);
                   if(servsocket==null)
         byte[] bt=recpacket.getData();
         String recvmess = new String(bt, 0, recpacket.getLength());
         InetAddress clientaddress=recpacket.getAddress();
         int clientport=recpacket.getPort();
         chatcom=new chatcom(this,clientaddress,clientport,recvmess);
         try{
              thread.sleep(10);     
         catch(InterruptedException _INExc)      
    chatcom is another class which i've created to differentiate if the data received is a message, new room, new user, etc... I've created my own RFC to make those differences. Like i said above, if a client has created a new room, the chatcom class will recognise that a new room has to be created and will therefore send the new room created to all other clients. So, i want to know how to get my "chatserver.jar" run on a web server like apache or even on a website if i want to upload this software. Coz once it starts running, i dnt hav to close the application. I mean to say that this application will have to run 24/7. Do i have to execute it externally using jsp codes? Is there any way to get my application run on a webserver?

  • How to run a jar file using Java application.

    Hi all,
    I know that jar file can run using the following command, using the command prompt.
    java -jar jar-fileBut I don't know how to run that command through a Java code. Hope it's clear to you.
    So can you please explain how can I do it.
    Thanks,
    itsjava

    rayon.m wrote:
    The solution given by ropp appears to have nothing to do with what you asked about.Ok sir, I got the point.
    I've try a test as follows. But it doesn't give any output. Even not an exception.
            try {
                String[] temp = new String[]{"java", " -jar", " MainApp.jar"};
                Runtime rt = Runtime.getRuntime();
                Process proc = rt.exec(temp);
                int exitVal = proc.waitFor();
                System.out.println("ExitValue: " + exitVal);
                System.out.println("Temp_Values");
            catch(InterruptedException ex) {
                System.out.println(ex.getMessage());
            catch (IOException ex) {
                System.out.println(ex.getMessage());
            }I've debug and see, but the exitValue is even not exist at run time. Can you tell me where I'm going wrong.

  • How to run exe (jar) file in java?

    hello,
    i can retrieve jar file but can't run from outside of JBuilder ..why?
    can u help me, pls?
    nway nge

    Multipost.

  • How to run a Jar file during runtime

    Runtime.getRuntime().exec("javaw -jar MYJAR.jar");was what I used to run the jar originally, and it worked. Recently I created an installer for my program, where the user runs a batch-file shortcut which launches the main application. Because the main application is launched from the desktop, rather than directly, the "user.dir" property is different which makes the above code not work. How do I get the name of the folder that contains the running java application?
    Thanks

    You don't. You fix the installer so that it puts the correct working directory into the shortcut that it creates.

  • How to run java exe files without having to install jre

    Hi all i want to run a java application. i already converted the jar file to exe using Launch4j but the problem is that i want to run the application on other computers without having to install jre. please, is this possible and if yes, how can i do that. Thanks alot in advance

    The Launch4J website should explain how to bundle the JRE. I've not really used it myself though. If you can't get it to work you could try the launcher I use:
    http://www.megaupload.com/?d=FYZAVM77
    which comes with instructions. Or:
    http://sourceforge.net/projects/javaround
    Both of which are really easy to use.

  • How to run a jar file in a HTML page.

    Hi, i have created an applet that works with 2 or 3 classes, the i have done a Jar file and now i want to run the applet though a Html page, i have looked at many manuals and i have done the same as is said to create the Html file, but whe i want to see the page on the part of the applet nothing appears to me and when i go though the area of the applet with de mouse an error message apears saying that the clas XXXX (the main class of my applet) can't be instanced.
    Could someone tell me why is this? i need help or to see an example that works.
    Thanks

    Hi, i have created an applet that works with 2 or 3
    classes, the i have done a Jar file and now i want to
    run the applet though a Html page, i have looked at
    many manuals and i have done the same as is said to
    create the Html file, but whe i want to see the page
    on the part of the applet nothing appears to me and
    when i go though the area of the applet with de mouse
    an error message apears saying that the clas XXXX (the
    main class of my applet) can't be instanced.
    Could someone tell me why is this? i need help or to
    see an example that works.
    ThanksUse the archive parameter in the applet tag.
    e.g: <applet code="your_main_applet" width="256" height="256" archive="myjar.jar">
    Where myjar.jar is the actual jar file which contains all the user class files which are required to run this applet.
    For creation of jar files, please read the java tutorial in http://java.sun.com
    /Sreenivasa Kumar Majji.

  • Open console when i run java jar file

    greetings all
    i have a java program that i execute through JCreater. i want if i make its JAR file then its console should be open so that i could see thats printing when i use "System.out.println". is there anyway? right now when i double click my JAR file then nothing is displayed. how can i make that happen?

    thx flounder
    you see i need to see whats printing through my System.out.println() command. I am working on JCreater at the moment. when i execute my program an output window is opened, it displays whatever i have written in System.out.println. now i want to make an executable JAR of my program and also want to see my output window. is there any way to do that?

  • How to run java .class file?

    How can i run/view .class file in java?. is there tool/utilities in java that can do that.?. Thanks

    Ednut wrote:
    I'm sure you must have been taught using the command: java yourClassName after navigating to the location of your compiled class in the command prompt.I'm sure the OP does not need condescending remarks from someone who knows almost as little Java as s/he does.

  • Explain how to run a jar file in Openscript in OATS.

    Hi..
    I have a jar file which essentially compares two files.I want to run it from Openscript. Please explain me the steps in detail (after adding in the assets field)
    Thanks in advance
    regards
    Harsha

    Hi,
    If you know the class name in that jar file create an object for that class and invoke function you needed.
    Regards,
    Deepu M

Maybe you are looking for

  • Help a newbie with Keyboard events

    Right so I'm just getting started with ActionScript (and Flash) and I'm getting a bit confused. I've got quite a bit of experience programming in other languages but I've never touched either actionscript or flash before. I've got various books and h

  • Getting a form item to load first in target page

    according to ben forta who i met many years ago, cf loads the complete page and then does functions in a particular order. i.e. includes, queries, etc. my problem is that i am sending over a unique identifer in the formset that is needed in an includ

  • My iPad 2 will not allow me to update my apps. When I hit the update button I get a spinning circle but then it times out and doesn't update. Please help.

    My iPad 2 will not allow me to update my apps. When I hit the update button I get a spinning circle but then it times out and doesn't update. In the past when I have updated successfully, the spinning circle would show me an indicator of time left on

  • Itunes 10.5.3.3can't re-open after closed

    I have a problem with itunes 10.5.3.3 (64 bit), after i closed itunes and i want to re-open again it doesn't open. Now i'm using windows 7.. Then, itunes can work again after restart the computer...Anyone do u have suggestion to fix this problem? Tha

  • Launchpad randomly rearranges apps

    For some reason my launchpad will rearrange some of the apps/folders. It isn't all the time and it doesn't move a lot of apps, just a few apps and only a few spaces from their normal position. No one else uses the computer so I know it isn't someone