JAR File ClassPath Problems

i have this directory structure:
deploy/
deploy/program/
deploy/program/(classes)
deploy/program/subfolder/
deploy/program/subfolder/(classes)
from deploy i am jarring with the command:
jar cfm Program.jar manifest.txt Program
with the following manifest text:
Main-Class: Program
Class-Path: Program/ Program/subfolder/
(new line with no space)
my main class is called "Program"
the classes in "Program" and "subfolder" are NOT in a package (they are "loose" classes)
ive tried MANY different entries for the manifest classpath but get the same result:
Exception in thread "main" java.lang.NoClassDefFoundError: Program
please help!

there are no packages because this is just a hack up demo with 15 or so classes.
i thought itd be easy enough to jar this without adding packages. : /
i could just throw them in one folder but this has become a battle of pride, lol.
DrClap if I jar from the Program folder instead of Deploy with:
jar cfm Program.jar manifest.txt *.class subdirectory
and manifest:
Main-Class: Program
Class-Path: subdirectory/
I get:
Exception in thread "main" java.lang.NoClassDefFoundError: (subdirectory class)
If I delete the Class-Path entry altogether I get the same Exception.

Similar Messages

  • Jar files download problems in Java Webstart with JRE 1.6

    We have encountered a few problems in Java Webstart with JRE 1.6
    In JRE 1.5, the jar files are getting downloaded onto the client
    machine with it's original names.
    Example :
    Server File Name : acm.jar
    Client File Name : RMacm.jar
    But in JRE 1.6, the jar files are getting downloaded with improper file names.
    Example :
    Server File Name : acm.jar
    Client File Name : 4fb074cc-66fc7407
    Moreover the path itself seems to be invalid.
    Example Path :
    JRE 1.5 path:
    C:\Documents and Settings\Administrator\Application
    Data\Sun\Java\Deployment\cache\javaws\https\D17.16.23.11\P443\DMtest\DMwebStart
    JRE 1.6 path:
    C:\Documents and Settings\Administrator\Application
    Data\Sun\Java\Deployment\cache\6.0\12
    Due to this, we are facing Classpath problems.
    What changes do we have to make to the code, for Java
    Webstart to work ?
    We are using JBoss 4.0.4 and JDK 1.5 in the Server
    On the client machine, we have IE 6 and JRE 1.6.01
    Help would be appreciated.

    Ask your Java Web Start question at:
    http://forum.java.sun.com/forum.jspa?forumID=38

  • Jar Files in a Jar File - Classpath Error

    Hi,
    I created a jar file that will have all the class files of the application. In the manifest file class path, I have the jar files the application is dependent on. The dependent jar files were kept outside of the application jar file. I was able to execute the main file in the application jar file. Then I created another jar file that holds all the dependent jar files the application is dependent on along with the application jar file into one super jar file. configured the main class attribute of the super jar file to that in the application jar file. When I try to execute it, I'm getting an error saying Class Not Found. Can someone guide me in setting the classpath for this super jar file in its manifest file.
    Presently my manifest file classpath variable in the super jar file is set as App.jar Depend1.jar Depend2.jar
    Thanks,
    E H

    Java's standard class loaders do not support jar files inside of other jar files, and will give the error you see.
    You can write your own customized class loader, use a 3rd-party solution (onejar at sourceforge is one), or remove the interior jars.

  • .jar file deployment problem

    Hi I am running a web application using tomcat 4.x .
    I want to deploy the appllication as war file in tomcat I did the following step:
    1.jar cf web.jar * use this command to make .jar file
    2. placed it in tomcat_home/webapp folder.
    it is able to get to the first page that has 2 frames. The pages in that frame are not been loaded. error 404 The requested resource (/integrate/jsp/default.jsp) is not available.
    is shown.
    Where could be the problem
    Thanks in advance.

    Hi I am running a web application using tomcat 4.x .
    I want to deploy the appllication as war file in tomcat I did the following step:
    1.jar cf web.jar * use this command to make .jar file
    2. placed it in tomcat_home/webapp folder.
    it is able to get to the first page that has 2 frames. The pages in that frame are not been loaded. error 404 The requested resource (/integrate/jsp/default.jsp) is not available.
    is shown.
    Where could be the problem
    Thanks in advance.

  • Jar file creation problem

    I have create the jar file, but it show the following error mesage since i start to run it.
    Java Virtual Machine Laugcher
    Failed to load the main class manifest attribute from
    E:\j2sdk1.4.2\bin\test.jar
    What the problem for this?
    my manifest.mf file contain the information
    Manifest-Version: 1.0
    Main-Class: mysystem.MainFrame
    note, my directory is javac mysystem/MainFrame.java to run

    Open the jar in WinZip (or any other).
    the mysystem directory should be in the root..

  • Jar file import problem with ADF application

    Hi Everyone,
    I am using Jdev 11g with integrated WLS. I have an ADF application and is trying to integrate JasperReport in it. I added the JasperReport JAR file in the project properties -> Libraries and Classpath, and checked it for "export" and "Deployed by Default'. I have my JasperReport codes in my managed bean
    as follows
    +public String cb1_action() {+
    +try {+
    +JasperDesign design = JRXmlLoader.load("C:/JDeveloper/mywork/ReentryApplication/ViewController/public_html/jasper/testReport.jrxml");+
    +JasperReport report = JasperCompileManager.compileReport(design);+
    +....+
    +}+
    +}+
    I am able to compile the managed bean class successfully. However when I run the application, I got a stack of errors like this,
    +[2009-10-08T11:31:59.910-04:00] [DefaultServer] [ERROR] [] [javax.enterprise.resource.webcontainer.jsf.application] [tid: [ACTIVE].ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: test123] [ecid: 0000IGollZuB5EirL4YBUA1AnVop00000L,0] [APP: ReentryApplication] java.lang.RuntimeException: net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:[[+
    +C:\Documents and Settings\MISSP29\Application Data\JDeveloper\system11.1.1.1.33.54.07\DefaultDomain\testReport_1255015914097_607807.java:4: package net.sf.jasperreports.engine does not exist+
    +import net.sf.jasperreports.engine.*;+
    +....+
    It appears that the JAR file is not picked up at the runtime correctly. I tried a simple Main class with the same codes and JAR file added, it works fine. Does anyone know what I am missing within the ADF application?
    Any helps would be appreciated.
    Thanks,
    John
    Edited by: john wang on Oct 8, 2009 9:24 AM

    Timo,
    Thanks you for your prompt response.
    1. I checked The following folder (I assume this is where it supposes to be). The JAR file is there.
    C:\Documents and Settings\MISSP29\Application Data\JDeveloper\system11.1.1.1.33.54.07\o.j2ee\drs\ReentryApplication\ReentryApplication-ViewController-webapp\WEB-INF\lib
    2. I did not do anything about deployment descriptor. Since I run my application within JDev integrated WLS, I did not do anything about deployment setting. Do I need do something with deployment descriptor if I want to import additional JAR files here? With my experience with 10g, to add a JAR file within JDev, all I need to do is to add it through project properties ->libraries.
    3. I agree with your absolute path comment. This is a test of how JasperReport works with ADF application. I will work it out later.
    Thanks,
    -John

  • Jar file execution problem

    Hello friends,
    I have a project folder in which i have 4 packages
    application
    ui
    controller
    model and
    a folder Datafile containing project related xml and text files
    my main class is in application package
    I am creating a jar file of my whole project folder in Eclipse environment, using the main class as TheApplication in application package. I am able to generate the jar file but unable to execute it.
    When I tried to execute it from command prompt it is giving me an error saying no main,
    Please tell me what I am doing wrong, and suggest me a solution
    Thanks in advance

    ya, You are required to put an entry in Malifest file.
    you need to add Main-Class <your class name with which you need to start ur application
    Wasn't this already shown in reply #7?> Yes it was, But as he said, even though he is getting the same problem.. So. I tried to recall him that, that class should the starting point to the application & it should be public & it should have public method.. And is not mentioned in that reply #7
    I guess you got my point now.

  • Creating jar file gives problem in WSAD IDE

    Hi,
    i programmatically created a Jar file successfully. I am able to open
    the jar file and read the jar file properly. But when i try to include that jar file into WSAD, it cannot recognize the class files within it.
    Any help would a great input.
    Thanks and Regards,
    Sapan.

    >
    2) U are having one program in which u are creating
    jar as well as using the class file in it at runtime
    using reflection. If this is the case then u might
    have to check manifest file of the project.
    If none of the above is the case then please explain
    little bit more, what r u trying to do.
    Regards,
    Samip.I m creating the jar file and then use the classes in the jar file through reflection / generics. I checked the default jar file that is created using jar command, and the manifest file doesnt have anything except, Sun Microsystems and jdk version.
    It seems that the problem is with the manifest of the jar file that is created. There is something that is missing in the jar file, and WSAD 4.0.3 expects the same.
    Regards,
    Sapan.

  • Jar file caching problem

    I'm running applets under IE in our application. The application contains multiple pages, each page with one applet. Each applet contains some shared jar file and one specific jar file for that applet.
    Most of the time, the caching mechanism work fines. The browser is able to check with the HTTP server to see if any new jar files and download automatically. If no updates, the cached jars (in browser) are used.
    However, at some other times, when I jump across several pages, performing different processing, suddenly the browser will reload all the jar files from the server. Even some shared jars are reloaded in every page within the same browser session.
    If above problem occurs, I close the browser, open a new one and jumping to the pages again, the browser will be able to use the cached version again.
    The runtime environment as follows:
    JRE 1.3.1_02
    IBM HTTP server 1.3.12.6
    IBM WebSphere Appl Server 3.5.3
    IE 5.50 (The "Check for newer versions of stored pages" is set to "Every visit to the page")
    Pages created by JSP, syntax as follows:
    <OBJECT classid="<%=JSPUtil.getClassid()%>" codebase="<%=JSPUtil.getPluginCodeBase()%>" WIDTH=100% HEIGHT=175% NAME=posApplet>
    <PARAM NAME=ARCHIVE VALUE="<%=JSPUtil.getSharedArchives()%>, <%=JSPUtil.getArchiveLocation()+"/posPending.jar"%>">
    <PARAM NAME=CODE VALUE=ho.aia.pos.pending.applet.PendingSGP >
    <PARAM NAME=NAME VALUE="PendingRequirement" >
    <PARAM NAME=codebase VALUE="<%=JSPUtil.getCodeBase()%>">
    </OBJECT>
    Do anyone knows anything about the problem?
    Anyone knows how to make the caching work NORMALLY?
    Thanks

    Recently I tried to used some robot tools to test our application for performance issue. During the robot testing, I acceidentally discover some difference for the jar downloading which cause the above mentioned problem.
    At first, this http request has no problem and the jar file is NOT downloaded. Http server shows a response code of "304", meaning download not required.
    http_request
    "GET lib/posLookup.jar HTTP/1.1\r\n"
    "Accept: */*\r\n"
    "Accept-Encoding: gzip, deflate\r\n"
    "If-Modified-Since: Thu, 05 Dec 2002 17:22:12 GMT\r\n"
    "User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0; T31246"
    "1)\r\n"
    "Host: defaulthost\r\n"
    "Connection: Keep-Alive\r\n"
    "Cookie: sesessionid=0001UULRZPFLU5IBRNBVHWUUAFI\r\n"
    "\r\n";
    Then after running for a while, the browser jumps into another page and finds that the same jar file "posLookup.jar" is required. It issue another http request to server as:
    http_request
    "GET lib/posLookup.jar HTTP/1.1\r\n"
    "cookie: sesessionid=0001UULRZPFLU5IBRNBVHWUUAFI\r\n"
    "User-Agent: Java1.3.1_02\r\n"
    "Host: defaulthost\r\n"
    "Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\r\n"
    "Connection: keep-alive\r\n"
    "\r\n";
    But this time the user agent becomes Java1.3.1_02 and the accept type becomes text/html instead of original zip format. After this, I check the IE temporary file and found that the posLookup.jar is having a type of "HTML Document" instead of "Executable jar file".
    Does anyone know whether this is a bug of the Internet Explorer or it is bug of the Java Plugin?
    Appreciate any opinions or comments.
    Thanks

  • .JAD/JAR file download problems

    Hi,
    I'm having trouble with downloads of .jad and .jar files through WAP onto my mobile phone. The .JAR file downloads fine via the WAP APN but then the .JAD file doesn't download.
    From what I can see, it looks like the j2me app manager on the phone which reads the jad file tries to download the .JAR file directly from the website. The problem here is that since i'm connected to a WAP APN, i have to download through the proxy so there's no direct access to the internet.
    Anyone else have this kind of problem?
    Is is possible to set up the .JAD file somehow so that it downloads through a proxy or takes the current APN to download it??
    This is a HTTPS site but I dont think that would make a difference.
    Cheers,

    Hello,
    I have a very similar problem. Not quite the same tho: i am able to download the JAD and the JAR gets requested. One some phones the JAR gets downloaded properly but on others it blocks after 50 or 60 %.
    We only encounter this problem when downloading through a proxy (defined in the phones wap/internet configuration); when we connect without a proxy everythibng works just fine.
    Another clue might be the fact that we cannot do HTTPS communication (from the device) using a connection that is proxied. (We tested by putting the file on the device using bluetooth).
    Has anybody seen this before? Do you know a solution to this problem?
    Thank you,
    Nick

  • How to add jar files  classpath in sun stdio creator

    Hi,
    i am using log4j-1.2.13.jar in my application.
    how to add it to my classpath in sun stdio.
    with regards
    shannu sarma

    Hi there,
    These threads will answer your question
    http://forum.sun.com/jive/thread.jspa?forumID=123&threadID=61842
    http://forum.sun.com/jive/thread.jspa?forumID=123&threadID=56060
    Thanks
    K

  • Run EJBC on jar file (in Weblogic)

    Hi all,
    Why do we have to use the following statement while creating a jar file for Entity Beans deploying in Weblogic App server.
    ==================================
    java -classpath d:/bea/wlserver6.0/lib/weblogic_sp.jar;d:/bea/wlserver6.0/lib/weblogic.jar weblogic.ejbc -compiler javac build\std_ejb_trader.jar d:\ejb_trader.jar
    ===========================================
    Any help will be appreciated.
    Seetesh

    Hi Deepak,
    java -classpath d:/bea/wlserver6.0/lib/weblogic_sp.jar;d:/bea/wlserver6.0/lib/weblogic.jar weblogic.ejbc -compiler javac build\std_ejb_trader.jar d:\ejb_trader.jar
    The installer of Weblogic 6.0 is that it doesnt have this Weblogic_sp.jar while installing whereas Weblogic 6.1 has this jar file.
    Problem in this case using Weblogic 6.0 is that without Weblogic_sp.jar d:\ejb_trader.jar file doesnt get created at all.
    Thanks for ur reply,
    Seetesh

  • Loading jar files

    hello,
    we are creating a framework for a project that should be able to load some modules from a jar file. Problem is: how do we load the class files and how do we specify the class that should do the work of the plug-in? DOes it has to be a public static void main method? I dont think it does because in that case you'd actually start a new application in stead of running it as a whole with the framework.
    Thanks in advance!

    To load classes from a jar file not part of the classpath at JVM startup; create a URLClassLoader and call loadClass on it for the fully qualitified name of the class.
    The simplest approach is to require your plugins to implement a common interface (which is on the classpath) and have a no-args constructor.
    That way you can avoid most of the complexities of reflection.
    If that's unacceptable you can define a factory class and put that in the plugin jar, then it can generate instances of the real plugin any way you like.
    A common trick is to have a list of plugin (or factory) classes inside the jar file which contains their classes. Say the plugins implement org.widget.MyPluginFactory then have a text file in
    META-INF/services/org.widget.MyPluginFactory and put the FQNs of the plugins in the file, one per line.
    Your framework can use getResources() on a class, or classloader to find all avaible plugins.

  • How to create and use library JAR files with command-line tools?

    Development Tools -> General Questions:
    I am trying to figure out how to put utility classes into JAR files and then compile and run applications against those JAR files using the command-line javac, jar, and java tools. I am using jdk1.7.0_17 on Debian GNU/Linux 6.0.7.
    I have posted a simple example with one utility class, one console application class, and a Makefile:
    http://holgerdanske.com/users/dpchrist/java/examples/jar-20130520-2134.tar.gz
    Here is a console session:
    2013-05-20 21:39:01 dpchrist@desktop ~/sandbox/java/jar
    $ cat src/com/example/util/Hello.java
    package com.example.util;
    public class Hello {
        public static void hello(String arg) {
         System.out.println("hello, " + arg);
    2013-05-20 21:39:12 dpchrist@desktop ~/sandbox/java/jar
    $ cat src/com/example/hello/HelloConsole.java
    package com.example.hello;
    import static com.example.util.Hello.hello;
    public class HelloConsole {
        public static void main(String [] args) {
         hello("world!");
    2013-05-20 21:39:21 dpchrist@desktop ~/sandbox/java/jar
    $ make
    rm -f hello
    find . -name '*.class' -delete
    javac src/com/example/util/Hello.java
    javac -cp src src/com/example/hello/HelloConsole.java
    echo "java -cp src com.example.hello.HelloConsole" > hello
    chmod +x hello
    2013-05-20 21:39:28 dpchrist@desktop ~/sandbox/java/jar
    $ ./hello
    hello, world!I believe I am looking for:
    1. Command-line invocation of "jar" to put the utility class bytecode file (Hello.class) into a JAR?
    2. Command-line invocation of "javac" to compile the application (HelloConsole.java) against the JAR file?
    3. Command-line invocation of "java" to run the application (HelloConsole.class) against the JAR file?
    I already know how t compile the utility class file.
    Any suggestions?
    TIA,
    David

    I finally figured it out:
    1. All name spaces must match -- identifiers, packages, file system, JAR contents, etc..
    2. Tools must be invoked from specific working directories with specific option arguments, all according to the project name space.
    My key discovery was that if the code says
    import com.example.util.Hello;then the JAR must contain
    com/example/util/Hello.classand I must invoke the compiler and interpreter with an -classpath argument that is the full path to the JAR file
    -classpath ext/com/example/util.jarThe code is here:
    http://holgerdanske.com/users/dpchrist/java/examples/jar-20130525-1301.tar.gz
    Here is a console session that demonstrates building and running the code two ways:
    1. Compiling the utility class into bytecode, compiling the application class against the utility bytecode, and running the application bytecode against the utility bytecode.
    2. Putting the (previously compiled) utility bytecode into a JAR and running the application bytecode against the JAR. (Note that recompiling the application against the JAR was unnecessary.)
    (If you don't know Make, understand that the working directory is reset to the initial working directory prior to each and every command issued by Make):
    2013-05-25 14:02:47 dpchrist@desktop ~/sandbox/java/jar
    $ cat apps/com/example/hello/Console.java
    package com.example.hello;
    import com.example.util.Hello;
    public class Console {
        public static void main(String [] args) {
         Hello.hello("world!");
    2013-05-25 14:02:55 dpchrist@desktop ~/sandbox/java/jar
    $ cat libs/com/example/util/Hello.java
    package com.example.util;
    public class Hello {
        public static void hello(String arg) {
         System.out.println("hello, " + arg);
    2013-05-25 14:03:03 dpchrist@desktop ~/sandbox/java/jar
    $ make
    rm -rf bin ext obj
    mkdir obj
    cd libs; javac -d ../obj com/example/util/Hello.java
    mkdir bin
    cd apps; javac -d ../bin -cp ../obj com/example/hello/Console.java
    cd bin; java -cp .:../obj com.example.hello.Console
    hello, world!
    mkdir -p ext/com/example
    cd obj; jar cvf ../ext/com/example/util.jar com/example/util/Hello.class
    added manifest
    adding: com/example/util/Hello.class(in = 566) (out= 357)(deflated 36%)
    cd bin; java -cp .:../ext/com/example/util.jar com.example.hello.Console
    hello, world!
    2013-05-25 14:03:11 dpchrist@desktop ~/sandbox/java/jar
    $ tree -I CVS .
    |-- Makefile
    |-- apps
    |   `-- com
    |       `-- example
    |           `-- hello
    |               `-- Console.java
    |-- bin
    |   `-- com
    |       `-- example
    |           `-- hello
    |               `-- Console.class
    |-- ext
    |   `-- com
    |       `-- example
    |           `-- util.jar
    |-- libs
    |   `-- com
    |       `-- example
    |           `-- util
    |               `-- Hello.java
    `-- obj
        `-- com
            `-- example
                `-- util
                    `-- Hello.class
    19 directories, 6 filesHTH,
    David

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

Maybe you are looking for

  • How can I report people that are harassing me on my question?

    I posted a question on how to fix a problem that I had with my iPhone. When a person posted me talked about dealing with an employer to solve the problem. No it don't matter how I read it I asked why did they assume that without asking me if I even h

  • Tax - MIRO and FB60

    Experts, We are in the processing of migrating a Co Cd from Non-SAP system to SAP System and we were planning to take care of the tax thing manually for now and then have it automised. However it looks like when you are doing FB60 - You can enter the

  • Different base value reference steps for same condition type

    Dear Gurus I have a scenario where I have single pricing procedure for normal sale and Intercompany billing. Condition type GRWR should take the base value from step 350 in standard scenario But in Inter company billing it should take the base value

  • How to clear the cached ResourceBundles

    Hi, I am using the Portal content translation for translating the text from English to Swedish. The problem is the changes do not reflect even after Publishing the Translation Worklist. Any idea where this is cached? It works after the restart of Por

  • CorrelationSets Initialization

    I am trying to work on an example regarding the additional feeds that a BPEL Service Component can receive while its running. I have the CorrelationSet defined with the correct Property and Property Alias. Also, the Reply activity has been configured