Help with classes in .jar file

Let say, there are additional classes in a .jar file
How can I add it to my java program so that it can be recognized/used in the java program?
Need response asap. by Today. TQ

help...jar... wrote:
Let say, there are additional classes in a .jar file
How can I add it to my java program so that it can be recognized/used in the java program?
Need response asap. by Today. TQClasspath.

Similar Messages

  • Help with creating a jar file

    hi sorry if this is not the place to post the topic but was not sure where to post it.
    i have make an application that has some images and a database but i would like to make a "exe" or somthing so that the client dose not have to open an ide and click run. they can just double click on somting. am not sure about how most of you distrbute your apps. can you help me please.
    the client will be useing windows 95.
    i know that a jar file can do this but i am not sure on how to change the refrences in the code to include the images and every thing. and how would i go about getting it into jar form
    thanks nibur

    You can create an executable jar.
    Note that even if you do this, the user will need to have a JRE installed on their machine for this to run.
    Here's how you can make this executable jar:
    Replace all code that refers to the filesystem (like if you do "File f = new File("c:\myDirectory\file.txt");") to use resources:
    http://java.sun.com/j2se/1.4.2/docs/guide/resources/index.html
    Create a manifest file that has a Main-Class: attribute.
    Then use the "jar" tool to create the jar:
    http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/jar.html
    That doc has "see also" links at the bottom that can tell you about executable jars and manifest files.
    If you're using an IDE, the IDE probably has a tool to create jars for you. In Eclipse, it's under File -> Export. Check your IDE's docs for details.

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

  • Can I increase heap memory without specify any class or jar file??

    Hi,
    I tried to increase my heap memory in this way :
    java -Xms256m -Xmx256m
    but I got an error ... it's seem that I must specify a class java or a .jar file ...
    This is the error :
    Usage: java [-options] class [args...]
    (to execute a class)
    or java [-options] -jar jarfile [args...]
    (to execute a jar file)
    where options include:
    -client to select the "client" VM
    -server to select the "server" VM
    -hotspot is a synonym for the "client" VM [deprecated]
    The default VM is client.
    -cp <class search path of directories and zip/jar files>
    -classpath <class search path of directories and zip/jar files>
    A ; separated list of directories, JAR archives,
    and ZIP archives to search for class files.
    -D<name>=<value>
    set a system property
    -verbose[:class|gc|jni]
    enable verbose output
    -version print product version and exit
    -version:<value>
    require the specified version to run
    -showversion print product version and continue
    -jre-restrict-search | -jre-no-restrict-search
    include/exclude user private JREs in the version search
    -? -help print this help message
    -X print help on non-standard options
    -ea[:<packagename>...|:<classname>]
    -enableassertions[:<packagename>...|:<classname>]
    enable assertions
    -da[:<packagename>...|:<classname>]
    -disableassertions[:<packagename>...|:<classname>]
    disable assertions
    -esa | -enablesystemassertions
    enable system assertions
    -dsa | -disablesystemassertions
    disable system assertions
    -agentlib:<libname>[=<options>]
    load native agent library <libname>, e.g. -agentlib:hprof
    see also, -agentlib:jdwp=help and -agentlib:hprof=help
    -agentpath:<pathname>[=<options>]
    load native agent library by full pathname
    -javaagent:<jarpath>[=<options>]
    load Java programming language agent, see java.lang.instrument
    -splash:<imagepath>
    show splash screen with specified image
    can I increase heap memory without specify any class or jar file??
    thx

    chiara wrote:
    Hi,
    I tried to increase my heap memory in this way :
    java -Xms256m -Xmx256m
    but I got an error ... it's seem that I must specify a class java or a .jar file ...
    This is the error :
    Usage: java [-options] class [args...]
    (to execute a class)
    or java [-options] -jar jarfile [args...]
    (to execute a jar file)
    can I increase heap memory without specify any class or jar file??The job of java.exe is to execute java bytecode.
    What is it supposed to do with your request to use 256m of memory for heap
    when you are not giving it a class or a jar to run?

  • Where to put common classes and jar files

    hi,
    i want to put some classes and jar files in a common folder so that it can be accessed by other applications is there any way doing that.In tomcat server they have common and shared directories once any classes are into that folder they are being accessed easily ,but i am having problems with sun one .
    Regards
    Ameem Sami

    Did you find a solution for this? I'm having the same problem.
    Thanks,
    Tony

  • Ojvmtc reports xy.jar is not a class or jar file

    Hi
    I am a little bit confuced because ojvmtc reports an error I can not imagine about:
    oracle@cikic-desktop:~/Downloads/dom4j-1.6.1$ ojvmtc /u01/app/oracle/product/11.1.0/mds/jdk/jre/lib/jce.jar
    /u01/app/oracle/product/11.1.0/mds/jdk/jre/lib/jce.jar is not a class or jar file
    The set is closed
    But jce.jar is a jar file and I can inflate it:
    oracle@cikic-desktop:/tmp/fo$ jar -xf /u01/app/oracle/product/11.1.0/mds/jdk/jre/lib/jce.jar
    oracle@cikic-desktop:/tmp/fo$ ls -l
    total 8
    drwxr-xr-x 3 oracle oinstall 4096 2010-05-03 19:40 javax
    drwxr-xr-x 2 oracle oinstall 4096 2010-05-03 19:40 META-INF
    And if I do a ojvm on a class file everything is working like expected:
    oracle@cikic-desktop:/tmp/fo$ ojvmtc javax/crypto/Mac.class
    The set is not closed
    96 classes are missing
    So It must be a configuration mistake somewhere ...
    Can you please help me out.
    Thanks
    Christian Maier

    Coole thanks, this works pretty well!
    Chris
    oracle@cikic-desktop:~$ cp /u01/app/oracle/product/11.1.0/mds/jdk/jre/lib/jce.jar /tmp/
    oracle@cikic-desktop:~$ ojvmtc /tmp/jce.jar
    The set is not closed
    131 classes are missing

  • Help on creating a jar file

    I created a game and I need help on creating a jar file.
    I know the basics such as having a root folder, a manifest file and what goes in it, etc. And I know some programs like JGrasp can do the jar file for you, but it tells me it cannot find the main class. Does anybody know another program that can do that for me, or can i easily do it manually?
    any help is appreciated

    You can use jar.exe to create jar files.
    Just type jar and hit enter on the console it will give the help message about parameters.
    if you do not really need to put any spesific menifest information. Just zip the files using some zip software and change the extenction to jar. (Thats what I am doing most of the time)

  • Work with ADF Library jar file

    Hi
    My English isn't very good
    I use jdeveloper11.1.1.3.0
    I want to work with ADF Library jar file.
    I created two generic application. In each application I have a View Obj(one for employees table and one for department table ) and added them to App Module,
    then I made a ADF Library jar file for each application: adflib_emp, adflib_dep
    Then I created two separated application and in each application I created a BTF .
    In emp_TF1 I added adflib_emp jar file to application and in dep_TF2 I added adflib_dep jar file to application.
    These two applications work well. Then I created ADF Library jar file for each of these applications named: adflib_TF_1 and adflib_TF_2
    Finally I designed a main page to use these two jar file(adflib_TF_1 , adflib_TF_2). I added thses two jar file to application and then I dragged and dropped each TF to main page as a region:
    <af:panelSplitter id="ps1" splitterPosition="500">
    <f:facet name="first">
    <af:region value="#{bindings.emp_TF1.regionModel}" id="r1"/>
    </f:facet>
    <f:facet name="second">
    <af:region value="#{bindings.dep_TF2.regionModel}" id="r2"/>
    </f:facet>
    </af:panelSplitter>
    When I run main application both TF show employees table, but one TF should shows department table and the other one should shows employees table.
    I read oracle document and created my application on base of it. But I don't know why this happen and how to solve it?
    Habib
    Edited by: Habib Eslami on Apr 7, 2013 8:46 PM

    Hi,
    most likely the names of the application modules are not different but the same, which means you have a naming problem. Application modules (if they should be used as is) must have a unique name
    Frank

  • Help with converting a Nero file

    I have previously converted a dvd insert designed with Nero into a pdf using adobe acrobat in order to send to someone else.  When I tried to do the same thing today with a new Nero designed insert the conversion wouldn't work.  The message said adobe didn't support the program that created the file.  Any ideas?

    thanks for your response.
    When I create a dvd insert or cd label etc using Nero the file extension is nct - nero cover template.  The printer wants the file as a pdf as he can't open Nero files.  I have version 9.3 of acrobat.
    Date: Mon, 18 Jan 2010 21:43:47 -0700
    From: [email protected]
    To: [email protected]
    Subject: help with converting a Nero file
    Nero is simply a CD/DVD burning application and should have no effect on the type of files that will eventually be on the CD/DVD.
    What type of files are you trying to convert and exactly how are you trying to convert them? Plus, it would help to know the version of Acrobat you are using.
    >

  • I had to put my computer by together without migration or time machine I NEED help with order of the files?

    I had to put my computer by together without migration or time machine I NEED help with order of the files?

    Hi, where are these other files exactly?

  • How to bundle java help class into jar file ?

    Hi, all,
    I have some package in my project, with which I have a java help jar file as classpath, when I run my project, I need the jh.jar file in directory /jar/jh.jar.
    Now, I bundled all my class packages into a jar file, my.jar, together with the /jar directory. When i run my jar file with command:
    java -jar my.jar
    It tells me couldn't find javahelp class.
    What shall I do? How can I create my jar file with the jh.jar?
    Thanks in advance.

    I think you'd be better off just adding the jh.jar as
    a classpath argument and running it like that:
    java -classpath /myjavalibdir/jh.jar -jar myjar.jar
    ...otherwise you're stepping into redistribution of
    binary issues licensing-wise. That won't work either; when you run java with the -jar option, it ignores both the -classpath option and the CLASSPATH environment variable. However, it will see jh.jar automatically if you put it in the <path-to-java>/jre/lib/ext directory. But for distribution purposes, it might be simpler just to combime the contents of jh.jar into myjar.jar (if you use Ant, its <jar> task makes that very easy). Or, you can just run it this way:java -classpath myjar.jar;jar/jh.jar MyMainClassBTW, I don't think redistribution is a problem; otherwise how anyone even use JavaHelp?

  • Problems with creation of JAR file

    Hi!
    I can't succeed in creating a JAR file for my application.
    I've followed the guide at http://java.sun.com/docs/books/tutorial/deployment/jar/basicsindex.html
    but apparently im doing something wrong....
    I've tried doing an extra Manifest file aswell as "Setting an Entry Point with the JAR Tool" as written in the guide. noen with success however :(
    I always get the error "Could not find the main class. Program will exit." from the JVM when I try to run my JAR file.
    Structure of my program:
    C:\searchpath\moresearchpath\projectname\src\
    inside src\ there are 3 packages called; "graphic", "client" and "server".
    I want to make a JAR file from the files in the "server" package. The "server" package consists of these following 4 files(and nothing more); "ClientHandler.java", "TestServer.java", "ServerModel.java", "ServerController.java".
    "TestServer.java" is my main class!
    This is an example of a command I've done in order to try to make a JAR file:
    "C:\searchPathToWhereJavaIsInstalled\jdk1.6.0\bin\jar cvfe sgwserver.jar server.TestServer server\*"
    This doesn't generate any error. However when I try to start the .jar I get following message "Could not find the main class. Program will exit."
    I've also tried creating manifest file manually but without success (with UTF-8 encoding and not double .txt ending on file)
    This is how the "Manifest.txt" file has looked when I've tried making one:
    Main-Class: server.TestServer
    I have used Netbeans 5.5 and Java SE 6 for development
    What am I doing wrong? Please help me :(

    If I try to run the one generated from Netbeans I get the following error message: "Failed to load Main-Class manifest attribute from C:\searchpath\moresearchPath\projectName\dist\projectName.jar"
    The thing is I need 2 JAR files, one that contains the files in the "server" package and one that has all other files. The other one is an applet and the files in "server" package are a standalone application.
    How do I get the standalone application's JAR file to work?

  • Problem accessing class in jar file

    Hello. I am trying to create a jar file from my already compiled classes. I have around 5 packages, and my programs' entry point is in one of the packages, we'll call package A. Each package has its own purpose and package A calls any needed package to perform their task. This works well when I compile, run and all. However, when I create a jar file, it only works with the local package and any calls to another package do not work. How can I get around this? any help will be appreciated

    This is the output..
    05/05/2010  10:19 AM        10,946,787 MYJAR.jar
                   1 File(s)     10,946,787 bytes
                   0 Dir(s)   1,434,251,264 bytes freeMy manifest file contains
    Manifest-Version: 1.0
    Class-Path: .
    Main-Class: Login.loginMain
    AndrewThompson64 wrote:Is the code [swallowing exceptions|http://pscode.org/javafaq.html#stacktrace] at any point?
    Nope..
    AndrewThompson64 wrote:
    How do you know that if there is absolutely no error output?The when I ran the code from my compiler, it has no errors, and it works smoothly. I have used a JAR for a single package program before and it worked well but this multiple package program is giving me the problem and I don't want to put all the files in a single package

  • Coldfusion having trouble while loading classes in Jar file

    Hi everybody.
    I have some weird problem with Coldfusion.
    I try to use a Jar file, that i put in the Coldfusion classpath. It works well (i can call some classes in the Jar file using the createObject() function ), but not every classes.
    For example,
    <cfset ServiceObject = createObject("java", "com.google.api.ads.dfp.v201204.NetworkServiceInterface")>
    <cfdump var="#ServiceObject#">
    this call works well, and i can the see the dump file.
    <cfset dfpServiceObject2 = createObject("java", "com.google.api.ads.dfp.v201204.NetworkServiceSoapBindingStub")>
    <cfdump var="#ServiceObject2#">
    This call fails, and i got a 500 error :
    ROOT CAUSE:
    java.lang.NoClassDefFoundError: Could not initialize class com.google.api.ads.dfp.v201204.NetworkServiceSoapBindingStub
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java: 39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorIm pl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at java.lang.Class.newInstance0(Class.java:355)
    at java.lang.Class.newInstance(Class.java:308)
    at coldfusion.runtime.java.JavaProxy.createObjectWithDefaultConstructor(JavaProxy.java:191)
    If i check in the Jar file, i can see the NetworkServiceSoapBindingStub class. Moreover, when i do the same thing directly in a java application, it works well. Nevertheless, Coldfusion is not able to load this class. How can this be possible? Do you have any idea to help me?

    I have not been able to resolve this to date. Does anyone have half a clue as to what I might be doing wrong?
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Alison Stohrer ([email protected]):
    Were you able to resolve this? I am having the same problem.<HR></BLOCKQUOTE>
    null

  • Problems accessing class in JAR file [err = -4000]

    Hi, my setup is as follows ....
    I have a seq file that is accessing a Java class file, TestStandClient.java. something like
    public class TestStandClient
       public String test (String arg)
          String returnVal = "";
          try
             TestClass testClass = new TestClass ();
             returnVal = testClass .test (arg);
          catch (Exception e)
             returnVal = e .toString();
          return returnVal;
    TestClass.java is
    public class TestClass
       public String test (String arg)
          return arg + " : [Jar object has modified string]";
    Now. TestClass is in a seperate jar. When TestStandClient :: test  is called i get a -4000 error. From the readme in the Java example file it is described as ....
    Error
    reading returned string
    The
    string returned from Java was corrupt. Verify that the return type of the Java
    method is a string value.
    I have noticed if I take out the call to the object in the jar file then everything works ok.
    Could it be a classpath problem? the StartJVM has its classpath
    pointing at the folder where the jar is and also at where the
    TestStandClient class file is. I also set the classpath for the Java
    step to be the same (location of jar and class file)
    So, can someone inform me of what support TestStand has for java? Does it support communicating with a class file that itself depends on other JAR files? This is surely the case?
    thanks in advance

    Dear PCR Barry,
    I am afraid that I must agree with my colleague Kostas, who replied to your first teststand post. These are very tricky, indepth issues, and will require quite significant investigation. Furthermore, it will be very difficult for us to answer via the forums as we will likely need more input from yourself. As previously suggested, if you have a Standard Service Program (SSP), you can generate a Service Request by calling or e-mailing your local branch.
    Thank you for your time, and I am sorry that I have been unable to help you further,
    Best wishes,
    Rich R
    Applications Engineer
    National Instruments UK & Ireland

Maybe you are looking for