How to set path to jar file (classes)?

hi,
i have a java program which uses a jar file (lots of classes). so, i run them all in eclipse but i want to run it on a command line, like through cmd from run.
the classes are found in a different folder, and the code snippet is found in another folder. so where or how to set the path to the jar file?

Write
c:/java -?
you can use the -cp pption to use your jar file or a folder with classes.
java -cp jar1.jar myclass.class

Similar Messages

  • How to get path of jar file

    I am using a class which is present in a jar file.
    There are lot of versions of this jar file are present on machine.
    I am accessing one class from this jar.
    How do I know which jar is used by application.
    How to get the path(path on machine like c:\java\lib) of this jar file.

    URL jarURL = this.getClass().getResource("/whatever.class");will return you a jar:// URL. Experiment with that. (Remember that "whatever.class" needs to be prefixed by the full name of the package the class is in.)

  • Setting path for third party class files

    I am using some third party classfiles in my JSPs for JDBC. When I use these files, in normal Java Programs everything is working fine ( I am setting the path by using the CLASSPATH environment variable).
    I did not understandt how to set classpath for these files (com.informix.jdbc.*) for use in iplanet 6.0.
    I have tried to keep this "com" folder in /usr/java/j2sdk1.4.3_01/lib folder, but, it is not still working. I tried to change the start-jvm file, but, I am still having problems.
    Can someone help me !!!
    --Murthy.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Hi,
    I changed the jvm12.conf file, but, it did not work. I changed the JDK Runtime Classpath in the Global Settings tab of the Administration Server and restarted both the webserver and the administration server and it worked.
    Thanks for your response.
    --Murthy.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • 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

  • How to call function in jar file?

    First, I can't write english well.(I'm korean.. ) sorry about that.
    I have known function in jar file.
    but I don't know how to call function in jar file.
    how can I this work?
    My project and another project are respectively developing D-project with me and other man.
    so i need it. or I can't do this work.
    I will paste other's source code in my source code.
    and then recomplie , build it.. but it is not my wish!
    thanks for reading my sentence.

    If you have a jar file with a class that you wish to use, then you must add the jar file to your class path ($CLASSPATH on unix, linux, etc. and %CLASSPATH% on Windows).
    Then you can use the class normally, just as you would if it were not in the jar.
    If you meant something else, you'll need to explain what you meant.

  • How to use javap with jar files ?

    how to use javap with jar files ?
    thanks

    As long as the jar is on the class path, your gold. So,
    javap -classpath myjar.jar mypackage.MyClass
    Chuck

  • How to access the database jar file using the derby 10.2.1.6 database ?

    Hi,
    How to access the database jar file using the derby 10.2.1.6 database ?
    I have used like below. And i am getting the following the error:
    "org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.apache.derby.jdbc.EmbeddedDriver'
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1136)"
    My context.xml file looks like this:
    <Context crossContext="true">
    <Resource name="jdbc/derby" auth="Container"
    type="javax.sql.DataSource" driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
    url="jdbc:derby:jar(\CalypsoDemo\database.jar)samples"
    username="xxx" password="xxx" maxActive="20" maxIdle="10"
    maxWait="-1"/>
    </Context>
    What could be the reason.?
    Any suggestions will be appriciated.
    Thanks in Advance,
    Gana.

    ya, I have restarted. Can you please tell me whether the path which i am giving is right or not in the context file?
    Thanks,
    Gana.

  • How do you create a jar file in JDeveloper 11.1.2.0.0

    How do you create a jar file in JDeveloper 11.1.2.0.0

    1) Select the project for which you would like to generate the jar.
    2) Right Click the selected right and select 'Project Properties'
    3) Select the 'Deployment' in the left tab.
    4) Click on 'New' to create a new deployment profile and in the popup dialog, select 'Jar File' profile type and provide the name.
    5) Press 'ok' to save the changes.
    6) Select the project and right click and select 'Deploy to' and select the jar profile name you have specified.
    The Jar library is generated and the full path to the library jar is shown in the log window.
    Thanks,
    Navaneeth

  • How do you convert a jar file into a java file,  ?

    how do you convert a jar file into a java file ?
    I am new to Java ,but have a little experience in C++ and Visual Basic.
    I want to edit and maybe create my own mobile games that are written or converted into jar files.
    At the moment I am using Java NetBeans , and Easy Java( the java pad).
    However the only solution I tried was to open the JAR file in winrar and see that its made up of png picture files,
    midi music files and class files. Unfortunately when I uncompressed the JAR file , there was NO java file to be seen and the JAVA editors Do not show the class file like a Java file. So why is there no extension Java file in the mobile JAR game ?

    801283 wrote:
    how do you convert a jar file into a java file ?You generally don't. There exist decompilers, but if you're meant to have the source, you should either have it because you are the author, or you should be able to get it from the author.
    I am new to Java ,but have a little experience in C++ and Visual Basic.Does that experience include turning .exe files into C++ code? Because that's the equivalent of what you're asking
    I want to edit and maybe create my own mobile games that are written or converted into jar files.Eh?
    Are you saying you want to take existing games and modify them? If the creators allow you to modify their source, then they'll provide you with that source (the .java files). If you're allowed to add things but not modify, you don't need .java files. Just documentation, which, again, the creators should be providing.
    Or are you saying you want to create your own games and distribute them in jar files? If so, there's no need to turn jars into .java.
    However the only solution I tried was to open the JAR file in winrar and see that its made up of png picture files,
    midi music files and class files. Unfortunately when I uncompressed the JAR file , there was NO java file to be seen and the JAVA editors Do not show the class file like a Java file. So why is there no extension Java file in the mobile JAR game ?Why would you expect there to be one?

  • How can I create a jar file

    Hello!
    How can a create a jar file?
    I want to run an application just clicking in a icon.
    How can I do this?
    Thanks a lot.
    K�tia.

    Get to the command prompt
    change directories to the directory where the main class resides.
    Open your text editor and type the following in it:
    Manifest-Version: 1.0
    Main-Class: NameOfMainClass //Just name without ".class"!!!
    Created-By: Your Name Here
    Save this file as whatever you want to name it with ".mf" as the extension.
    Then go back into the command prompt and type the following:
    jar cfm "NameOfJarFile".jar "NameOfManifestFile".mf *.class
    (without the quote marks of course)
    Hit "Enter"
    This will jar it up and make it executable.
    If you have any images associated with the program you can add them in the same way as above. Just add *.gif or *.jpg after the *.class portion.
    Good luck!
    LEEMAX I. T.

  • How to set up a basic file sharing server for my small architectural business?

    I have no idea if I have posted in the correct area as this is my first forum post within the apple support community!
    I have been using a 21.5" imac running 10.6.8 for the past 5 years to run my small home based architectural design business. I have been using the internal hard drive & backing up the necessary data to a simple usb external hard drive. I am now looking to firstly purchase a new imac 27" retina and purchase new autocad lt 2015 for mac software. I am looking to have another imac (my old mac) running in conjunction with the new mac. I want both macs to be able to access the same data and am slightly unsure what is the best way to achieve this.....As my old mac is currently only running snow leopard and an old version of autocad for mac 2011 it wont run on any more recent OS. Essentially i believe I have 2 main options with this.... (1) I Accept that I have to purchase 2 no. autocad lt 2015 licences @ a cost of £2300. Or option (2), I only run autocad on the new mac as this will be the primary station and the old mac used for primarily for admin & accounts. I have also recently discovered that it is possible to rent autocad licences for £300p/a which may also be another option (3)!
    I previously had a problem where my hard drive failed on my mac & lost all data on the internal hard drive, luckily I had been backing up all data regularly to my external hard drive and now loss occurred! Obviously with any new system I want to ensure that my data is safe!
    I currently utilise about 250GB of data for business operations but this will obviously grow with time.
    In the future I would like to have the option of potentially being able to access the network data remotely via macbook pro whilst abroad although at this stage this really isnt my primary objective. Although I believe I could achieve this through apple remote desktop.
    I suppose I should provide some information with regard to the required speed of the system...I regularly open 50-100 photos at the same time totalling around 250-500MB. I would like the system to be able to handle this fairly easily.
    I have been trawling through forums and to be honest they are totally confusing me. I have also spent time on the phone to the apple business team and have also discussed my objectives with a member of the apple team in store.
    There have been various options advised to me and I really do not know which is the most appropriate route forward.
    1 - Using a mac mini as the file server and linking the 2 mac devices to this and backing up the mac mini to an external hard drive to ensure no loss of data.
    2 - Using a time capsule as a file server and linking the 2 mac devices to this and backing up the TC to an external hard drive to ensure no loss of data.
    3 - Using the new mac hard drive and linking the 2 macs via thunderbolt (old mac does not have thunderbolt and so I guess I would need another new mac?!) and then backing up the data to a time capsule.
    4 - Using a RAID based server and linking the 2 no. macs.
    Sorry to ramble but any advice really would be greatly received!

    Hi sblemings,
    Welcome to the community.
    I think with your scenario you should ask yourself, how complicated do you want the setup to be and how much time would you have to be able to resolve an issue should one occur with this setup.
    All the options that have been advised would work but they come with complexity and therefore time.
    1 - Using a mac mini as the file server and linking the 2 mac devices to this and backing up the mac mini to an external hard drive to ensure no loss of data.
    2 - Using a time capsule as a file server and linking the 2 mac devices to this and backing up the TC to an external hard drive to ensure no loss of data.
    3 - Using the new mac hard drive and linking the 2 macs via thunderbolt (old mac does not have thunderbolt and so I guess I would need another new mac?!) and then backing up the data to a time capsule.
    4 - Using a RAID based server and linking the 2 no. macs.
    Sorry to ramble but any advice really would be greatly received!
    option 1
    Would be a way to achieve what you want, it would centralise your files and you would only need to backup your file server (as long as all the files you wanted backed up were on it). This could be achieved either using the client and sharing various folders or using Server which would give you more options than you would possibly need.
    option 2
    This is exactly like option 1 except that you wouldn't have to administer another mac however you may limit any future growth.
    option 3
    This option I probably wouldn't pick, you could achieve this with firewire and use a firewire to thunderbolt adapter (saves you having to buy a new iMac)
    option 4
    This option would, depending on your RAID level, give you disk redundancy but remember you would still need to back this up, as RAID is NOT a backup solution.
    I would also ask is there a pressing need to keep the old iMac in service and complicating things by having a server / NAS? Could you not just transfer all your information over to this and continue with the one backup? I would say that doing it this was would be the simplest way of achieving what you want from what I can take from your question.
    As for remotely accessing your data, if you have the right hardware the way to achieve this would be to use a VPN and connect back to your data. However a potentially easier way for you ,would be to use a service like logmein or teamviewer to connect back.
    Hope this helps, and by all means any questions please ask.
    Dan
    How to set up a basic file sharing server for my small architectural business?

  • Applet : How to use Images in Jar file

    I want to put all images into a jar file to improve speed of loading.
    But how to invoke images from Jar file?
    Thanks.

    @Op. It's very important for a developer to know how to find information, and that skill usually comes with experience. Google is one of the best ways to find information and solutions to the most common problems.
    Kaj

  • Please help: Example how to peploy application from jar file step by step

    Please help: Example how to peploy application from jar file step by step.
    All help appreciated
    Mike

    Thanks I will try these links
    Mike
    "Slava Imeshev" <[email protected]> wrote:
    Hi Mike,
    These links could be useful:
    http://e-docs.bea.com/wls/docs61////adminguide/appman.html
    http://e-docs.bea.com/wls/docs61////quickstart/quick_start.html
    http://e-docs.bea.com/wls/docs61//////ConsoleHelp/application.html
    http://e-docs.bea.com/wls/docs61///programming/environment.html
    Regards,
    Slava Imeshev
    "Mike" <[email protected]> wrote in message
    news:3ca0e94c$[email protected]..
    Please help: Example how to peploy application from jar file step bystep.
    All help appreciated
    Mike

  • How to add the mail.jar file to my CLASSPATH ?

    Hi;
    I wish to Instal JavaMail 1.2
    To use the JavaMail 1.2 API, i unbundle the javamail-1_3_1-upd.zip file.....and now, i would like to add the mail.jar file to your CLASSPATH.
    My question is: how do you do this ?
    - ok i did that for CATALINA_HOME & JAVA_HOME but how to add the mail.jar file to my CLASSPATH ??
    1000 thanks.

    I think you're looking for "developer support", not packaged application support. different server, different batch of groups. . .
    Since I have very little contact with devopers, I don't truly know.

  • How to Set JFilechooser to show file with the same extension in the filetyp

    How to Set JFilechooser to show file with the same extension in the filetypes??
    help

    I also don't understand, but if you mean how to display only files with a certain extension in your JFileChooser then you should have a look at the JFileChooser API:
    http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JFileChooser.html
    The introduction shows an example of how to do that.

Maybe you are looking for

  • UK Payroll Configuration document or Help

    Hi Every one .. Please help Me.. I am in immediate need of UK Payroll configuration document. i am at client place ..now.. Kindly send the document to my mail id : [email protected] Regards Samson

  • Problem in print out with English characters (THANGSAN font)

    Save Our Environment. Save Yourself. Hi Experts!! I have created a smartform and print program which should actually print some Thai characters and English characters too. I created a smartstyle and have some 10 paragraph formats and are all have THA

  • Tolerance Group--Cash discount Adjustment

    Dear All, Pleasse help me to understand the "Cash discnt adj.to" setting in the configuration for tolerance: I have the following setting: Amount per document                1,000,000,000,000.00 Amount per open item account item      99999,999,999.00

  • Don't have enough international facilities ?

    hi. is there any possibitly to contact apple because on mauritian itune store these is nothing good (include for ipad ipod and apple tv) i have all of them but cant really enjoy it fully. and even the reseller here is not a good one the are not proff

  • QT player export function for iPod doesn't work!

    hello i just bought QuickTime Pro. unfortunately, the export function for iPod (.m4v) doesn't work... it stops after a short while and dont't go any further. thanx for your help! greetings, iMats iMac 800MHz PowerPC G4   Mac OS X (10.4.3)