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?

Similar Messages

  • 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

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

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

  • 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

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

  • How to make a jar file downloadable with IE

    hello,
    I just bought a website:
    http://www.frozenfountain.net/
    and I put a jar file on it called Logo.jar
    Using Mozilla, the jar file downloads as expected, but with Internet Explorer, it tries to download it as .zip file.
    How do I get it to download as a .jar file with IE?
    thanks

    Just post a link to the Jar. Mozilla will download
    it as a jar. Windows will download it as a zip.
    Only one link. No problem, really. ;-)There is a problem. People who arent as good with computers as you are won't know how to run the jar file after downloading with IE.
    At school, I told someone to download the file, which they did with IE. It downloaded to desktop as a zip. They extracted and were left with a bunch of .class files.
    On a sidenote, how do you draw text with a gradient?

  • Run a JAR file!!!

    How to run a JAR file....

    you need to specify the
    Main-class: your class contains main method here
    attrbute in Meta-inf
    nd you can run usinf
    java -jar yourjar.jarThe question was not, "How do I create a manifest file that will allow me to run my jar file?" It was simply, "How do I run a jar file?"

  • How can i run a jar file as EXE on mouse click..

    *{color:#0000ff}how can i run a jar file as EXE on mouse click..is it possible in any way?????????{color}*

    amrit_j2ee wrote:
    *{color:#0000ff}how can i run a jar file as EXE on mouse click..is it possible in any way?????????{color}*Do you mean converting it from a jar file to an EXE file or do you mean that you would like to run the application by just double clicking it?
    If it's the latter then you need to make the jar file including a manifest.
    The manifest can be just a txt file with its content to be something like this:
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.7.1
    Created-By: Somebody
    Main-Class: NameOfTheMainClass
    Class-Path:
    X-COMMENT: Main-Class will be added automatically by buildTo make the jar file including the manifest, use something like this in your command prompt (of course you must have compiled your java file(s) first):
    jar cfm test.jar MANIFEST.txt NameOfTheMainClass.classAfter that you'd be able to run your application just by double clicking it.
    If you're a NetBeans user, you can build your standalone application by right-clicking your project and then going to properties => run => and choosing a Main class. After that right click on that project and "Clean and Build", locate the jar file in the "dist" folder and double click it =]
    Hope it helps,
    LD

Maybe you are looking for