How to make .jar file for a multiple class program

I have a code for a chat room that contains two folders , one for Server and one for Client
What I need is to create a jar file for the server and a jar file for the clients
but here the first problem , I have a file that named (SocketMessengerConstants.class) that is located outside the two folders and is being read by the two projects .
I mean the server uses it while running and the client uses it too .
the second problem is : I don't know how to create a jar file at all !
please tell me how to do it in detail
Thank you

ChuckBing wrote:[Packaging Programs in JAR Files|http://java.sun.com/docs/books/tutorial/deployment/jar/index.html]
I tried to read this tutorials before I come here but I couldn't understand it
can you please tell me a specific steps to follow instead of the explaining .. because I understand the explanation but I can't apply it

Similar Messages

  • How to make jar file for this compilation method ?

    can any one tell me how to make jar file for this compilation
    D:\java\browser\IEInJava>javac -classpath jdic.jar;. IEInJava.java
    D:\java\browser\IEInJava>java -cp jdic.jar;. IEInJava
    *this is a compile code:-*
    D:\java\browser\IEInJava>javac -classpath jdic.jar;. IEInJava.java
    *and this is a run code:-*
    D:\java\browser\IEInJava>java -cp jdic.jar;. IEInJavanow how make JAR file ?

    Assuming IEInJava only uses classes inside the jdic jar, this is one way. D:\java\browser\IEInJava> jar cf yourjar.jar IEInJava.classThen to run it you would use D:\java\browser\IEInJava> java -cp jdic.jar;yourjar.jar IEInJavaAnother way would use the jar manifest file to specify the Main-Class and Class-Path.

  • Help! How to create Jar file for a packaged class?

    Hi!
    I am new in jar complexities. I made a swing frame that just prompts a JOptionPane when executed. I accomplished the same using jar without packaging my class SwingTest.
    But when i package it, it doesn't run. Can any one tell me how to make jar file of packaged classes and include images in the jar files too!
    Really Thanx!

    Call the Jar from the commandline to see the exceptions thrown.
    java -jar <jarFileName> <className>

  • How to make jar files availabe for deployed EJBs

    Hi,
    I'm interested on how to make jar files availabe for deployed EJBs.
    My EJB is packed in an ear. It uses a util jar. I now just add the jar to the
    classpath, but I think that shouldn't be the way. Is there somthing in the admin
    console to make jars available or do I have to insert it in the ear file? And
    if so, where do I hve to place it?
    Thanks
    Claudia

    Put the util.jar in the ear with your ejb jars - at the same level (i.e. in
    the root) - but do not include them in the manifest.xml.
    Also each ejb jar that refers to util.jar must have util.jar on its internal
    classpath in the manifest.
    "Claudia" <[email protected]> wrote in message
    news:3d537db5$[email protected]..
    >
    Hi,
    I'm interested on how to make jar files availabe for deployed EJBs.
    My EJB is packed in an ear. It uses a util jar. I now just add the jar tothe
    classpath, but I think that shouldn't be the way. Is there somthing in theadmin
    console to make jars available or do I have to insert it in the ear file?And
    if so, where do I hve to place it?
    Thanks
    Claudia

  • How to make Jar files in JBuilder

    I would like to know how to make jar files using JBulider. I have a problem with a project that I am working with in Swing. I have made the project on JBuilder and when I make a jar file it will not run upon clicking.
    Any body with an answer, please help
    Abhi

    It sounds like your Main-Class is not set properly in your manifest. To set your Main-Class, please follow these directions:
    http://java.sun.com/docs/books/tutorial/jar/basics/run.html

  • How to import WMV file for use in adobe programs, especially After Effects and/or Premier?

    How to import WMV file for use in adobe programs, especially After Effects and/or Premier?

    I have the latest adobe creative cloud and i'm using Mac 10.8.2
    My client gave me a wmv file that she wants some people blurred out in the background but when I go to import the media, it's greyed out. I'm assuming that After Effects will be the best solution for this, but maybe there is another way.
    I can purchase a video converter and convert it to .mov but that costs extra money that I don't want to spend just to do this one project.

  • How to make jar files at runtime in a server application

    I am using Jung API and i need to load the class files in this JAR file for my application at runtime.
    I am using an applet which uses this API which is loaded with the help of a Servlet.
    The code is getting compiled but the JAR files and associated classes are not available at the runtime
    How to make themk avalable.
    I have tried various options like placing jar files in
    WEB-INF/lib
    $Catlina_Home/commons/lib
    But it is not working can anyone help me it is of high urgency to me
    How to make that classes in the JAR file available to my applet at runtime

    SuperJavaHello wrote:
    How to make that classes in the JAR file available to my applet at runtimeAhh! The runtime is an appler! The applet is on the Client, and the Client does not have access to the Server's classpath. You need to un-pack the JAR, then re-pack the classes into the JAR used to pack your Applet, the one that you are using as the code source in the applet tag.

  • Can we make jar file for simple j2se application

    Hi..Can we make a jar file for simple j2se application so that it can be executed on any system like .exe file...

    Read the JAR files section in Sun's Java tutorial.

  • How to make jar file?

    hi
    i want to make my jar file of my own package name "practise".
    can u help me in making jar file.
    what is the command to make jar file?
    expected name of jar--> runner
    package for which i want to make jar----> practise
    plz help me in this regard.
    i m very greatfull to your precious comments and suggestions.

    hi
    if u r creating first time means...
    jar cf filename.jar *.*
    u want to update jar
    jar uf filename.jar *.*
    extract
    jar xfv filename.jar
    (filename is ur package name)
    do this...
    .

  • How To make jar file through Command Promt and run it through Command Promp

    Now i am using Netbeans to create jar file but i want to create jar file for my project through command line and also want to run through command line

    Note: This thread was originally posted in the [JDK's Monitoring & Troubleshooting Tools|http://forums.sun.com/forum.jspa?forumID=538] forum, but moved to this forum for closer topic alignment.

  • How can I make .jar files for applications?

    My jar program creates jar files but won't open the program when I double click them. I use the command:
    jar cvf *.jar filenames
    The jar file is created but won't execute. Can anyone tell me what i am doing wrong?
    Thanks
    Jiby

    Hello !
    Well, I had the same problem a week or two ago !
    First, in your *.java, don't use any package...I mean, don't do a package of your program (I guess there is a way to make it work with, but it would need a little bit more work...).
    Then, with the jar tools, use the command
    -jar cf jar_that_you_want_to_create.jar class-that_you_include_in_your_jar.class
    With that, a jar will be created, and when you will try to "run" it, it will say that it can not find the main class...
    You need a Manifest !
    Create a text file MyManifest.text, and write that in your text file :
    Main-Class: classname
    follow the same as i wrote above. leave a blank after colon and a blank line after the first line like above.
    then, well, use tha jar tool again:
    -jar umf MyManifest.txt jar-file-you-created.jar
    To "run" it, double click on it, or use the java tool:
    java -jar jar_you_created.jar
    Thanks to Phani, who helped me with that !!
    Splitsch

  • How to deploy jar file for use within mapping user-defined fcn

    Hi all,
    I have a java class I'd like to called from a mapping user-defined function.
    Here's what I've done (but hasn't worked)
    1. Added 'package com.<mycompany>.xi.util.base64 to the source class file and compiled it.
    2. Created a sda with a plain provider.xml file, i.e. no references were made to any other library files.
    3.  Deployed the sda to the xi 3.0 j2ee server successfully using SDM.
    4.  Under the Visual Admin tool, I see that the library was deployed successfully.
    5.  In the import text box in the user-defined function (design time), I enter com.<mycompany>.xi.util.base64.*.
    A syntax check returns an error indicating the package could not be found. 
    Can anyone give me pointers as to how I can get this working?
    Thanks,
    --jtb

    Hey James,
    No! That's not the right way!
    What you have done is for accessing external JMS & JDBC drivers in their corresponding adapters. For the access inside a mapping user defined function, it's enough if you import the jar files.
    Look at this blog and you will be very clear!
    /people/divya.vidyanandanprabhu/blog/2005/06/28/converting-xml-to-pdf-using-xi
    regards,
    Felix

  • How to make .jar files executable by double clicking

    hi,
    I've been trying to make my .jar file created via ANT Tool executable by double clicking it but I'm not being successfull. I looked at the ANT Tool for making manifest.mf and I included most of the attributes listed there and later found that Main-Class attribute is required but its not mentioned in the documentation.
    So, I'll be very greatful to receive any suggestions
    regards,
    Jay

    ya I've been doing things the same way mentioned there but it isn't working. here is the code for it:
    //All the .class files are in the build directory and the class files are under the package org.home.proj.
    <!-- For making .jar files -->
    <target name="jar" depends="compile" description="Makes CyberStation.jar from the CyberStation code.">
        <mkdir dir="${bin}" />
        <jar jarfile="${bin}/CyberStation.jar" basedir="${build}">
          <exclude name="**/run.bat" />
            <manifest>
           <attribute name="Buily-By" value="${user.name}" />
           <attribute name="Main-Class" value="org.home.proj.CyberSoft" />
             <section name="org/home/proj/CyberSoft.class">
               <attribute name="Sealed" value="false" />
             </section>
         </manifest>
        </jar>
      </target>It show the error: Could not find the main class. The program will exit.
    regards,
    Jay

  • How to make installer file for windows?

    Hi,
    I want to make a installer file for auto installing the ssl certificate. My folder contains following files:
    1. importpfx.exe
    2. Main.java
    3. Main.class
    4. TestCertificate.p12
    I want to bundle above files into a single setup file.How should it be done?
    Thanks in Advance

    If you want to make an installer file for windows, i think below link is suitable for your requirement. I never tried this approach of creating the installer file of java applications. But while reading the description of it, i thought that it may suits to your requirement.
    Here is the link : http://www.ej-technologies.com/products/install4j/overview.html
    Description : install4j is a powerful multi-platform Java installer builder that generates native installers and application launchers for Java applications. install4j excels in its ease of use, its extensive platform support and its powerful screen and action system
    Thanks,
    Uday.

  • CS3, Encore; How to make a file for a mediaplayer

    Hallo there,
    How can I make a file in Encore CS3 that is readeble in a mediaplayer like a Popcorn.
    I know how to build a Blu-ray ofcourse, but I want to deliver a file to my customer for his mediaplayer.
    Can someone help me, because Adobe helpline in Holland does not cover Adobe CS3 anymore.
    I hope to hear from someone out there on this planet
    Greetings,
    Bert

    From Encore nothing that results in a single file.
    2 options.
    1) Build to a folder and play the DVD folder.  The method varies on the mediaplayer.  For Windows Media Player on XP, I just right click the first .ifo file in the VIDEO_TS folder and "Play."
    2) From Encore, Export to Flash.  The produces a web page (and folders) that can be played locally through a browser.

Maybe you are looking for

  • While using a BDC in the background for some documents its hanging.

    Hi All, I had used BDC call transaction program and i am scheduling the program in the background. Normally it works fine but for some quotes it hangs and takes a long time. So its not going to other quote. Any solution how to kill the hanged quote a

  • GetResourceAsStream... what is a Resource?

    I'm working on an applet that ships application data (lots of it) in jars. I'm using getResourceAsStream to read the resources from the jars and things seem to be 'fine' but I'm wondering why, everywhere I see samples of getResourceAsStream, its load

  • IPhone Photo Sync Issues

    I have an iPhone 4 from 2011 and a MacBook from 2009.  It's been a couple months since I've plugged in my phone to update/sync, and it won't allow me to access any photos!  It synced my music, apps, etc via iTunes but wouldn't sync my pictures. Since

  • J2SDK instalation failure- missing sd142000.cab file

    Hi, I am trying to install JDK1.4.2 on Window xp but installation gives error message "sd142000.cab file is missing in Documentandsetting\EI5\Temp folder." I tried searching my machine but could not find the above stated file. I would appreciate some

  • Message Processor should not be same as Reported by

    Dear All, Is there are any configuration settings that can be done so that when the reported by and message processor are same then it should not allow to save the support ticket? Regards, Rajesh Kumar.R