Class-Path assistance needed for jars

I'm having trouble with my Jar files. I have all the classes associated w/ the project in jar files in a lib directed. I then jar that directory w/ the main class file along with some extra directories (images etc). When I run the jar file created using the -jar switch...it states that it can't find a file that is inside the jar file itself. It will work if I have the directories and the files un-jar'ed in the same directory as the jar however I'm hoping that I dont' have to do that.
Below is my manifest file:
Main-Class: btCommander
Class-Path: lib\namespace.jar lib\relaxngDatatype.jar lib\jaxb-libs.jar lib\jaxb-api.jar lib\jaxb-impl.jar lib\classbox.jar
(i do have a carriage return after the last jar file in classpath).
When i jar the files (using either Ant or jar.exe) it packs the files however it doesn't allow me to execute the jar alone.
Any help will be appreciated.
Llama

http://forum.java.sun.com/thread.jsp?forum=22&thread=405160&tstart=0&trange=100

Similar Messages

  • Class-Path assistance needed in Jars

    I'm having trouble with my Jar files. I have all the classes associated w/ the project in jar files in a lib directed. I then jar that directory w/ the main class file along with some extra directories (images etc). When I run the jar file created using the -jar switch...it states that it can't find a file that is inside the jar file itself. It will work if I have the directories and the files un-jar'ed in the same directory as the jar however I'm hoping that I dont' have to do that.
    Below is my manifest file:
    Main-Class: btCommander
    Class-Path: lib\namespace.jar lib\relaxngDatatype.jar lib\jaxb-libs.jar lib\jaxb-api.jar lib\jaxb-impl.jar lib\classbox.jar
    (i do have a carriage return after the last jar file in classpath).
    When i jar the files (using either Ant or jar.exe) it packs the files however it doesn't allow me to execute the jar alone.
    Any help will be appreciated.
    Llama

    If I understand your problem correctly, the reason is because jar files cannot contain other jar files. Well they can but you won't be able to load any classes from them.

  • Color assistance needed for commercial printer

    Hi there,
    We're a board game publisher about to send our first game to an overseas manufacturer. The game is composed of hundreds of cards with detailed, fantasy art, and we're excited to get this game finally out the door.
    We sent the raw, packaged indesign (CS6) files to a local printer to see how everything would look before we have 3,000 copies of the game made overseas. The local printer used the same process that the overseas printer will, a 4 color high-end printer that is certainly impressive to people new to the industry such as ourselves. The sample cards they printed came out with fantastic clarity, but the colors are very muted. It's not a subtle change in color like I might see when toggling RGB to CMYK in photoshop for example. Instead, the colors on the print out look like someone slid a color saturation slider on the entire indesign file down by 25%.
    When we print on our low-end inket at the office, the resolution is obviously poor, but the colors look great and match our calibrated monitors. When we export to PDF using "Press Quality", everything looks perfect on multiple computers here and at other locations away from the office. It's only the most important step, printing on a full-blown, commercial printer that the colors look so muted.
    Here are some crude photos I took on my phone to help show the difference.
    These photos have our office, inkjet printer cards are more colorful and the high-quality commercial printer cards are muted (sorry for the strange alignment, this forum is rotating the images for some reason):
    http://www.watchtowergames.com/wp-content/uploads/2014/02/photo-1.jpg
    http://www.watchtowergames.com/wp-content/uploads/2014/02/photo-2.jpg
    http://www.watchtowergames.com/wp-content/uploads/2014/02/photo-3.jpg
    Different cards here:
    http://www.watchtowergames.com/wp-content/uploads/2014/02/photo-1b.jpg
    http://www.watchtowergames.com/wp-content/uploads/2014/02/photo-2b.jpg
    I've researched about swatches and color profiles, but all my experimenting hasn't produced any difference on my end. Therein lies the challenge, as I cannot duplicate the problem here at the office. The colors look great in indesign, great in exported PDFs, and great on our inkjet printed cards. Only when we pay a decent amount of money to the local commercial printer do we get these muted colors in our samples. And the local printer says their setup is exactly the same as our overseas manufacturer, which is terrifying. We've spent 17 months agonizing over all the details of the look of our cards for aesthetic purposes and game play so that players can quickly identify each card type by color. These muted colors will really mess the game up. We're pulling our hair out over here.
    The local printer has offered to provide a color correction service for us, but at $100 an hour, that sounds like a lot for a new business like ours.
    Is there some setting inside indesign that we are missing? Is there a way to replicate the muted colors on our end so we can at least troubleshoot this? Is there a method to turn up the saturation, if you will, for 4 color printing? Should we bite the bullet and pay the local printer an arm and a leg to color correct this? Any help would be greatly appreciated.
    Thank you,
    Tom
    P.S. Also, if it helps, when we had the local printer digitally print a sample, everything looked far too dark, which they said was a side effect of the digital print process.

    Thanks for the response, Rob.
    We talked with a local printer as they assured us that their setup was the same standard that the overseas printer uses. They said the sample sheet they printed for us had marks on the edges. Supposedly, once we had everything matching up right with the local printer, we could mail the printed sheet here to the overseas printer and their system would put in the sheet with its colors on the edges and know exactly what we wanted. Heck, if I know. I'm picking this up as I go along.
    By your post, it sounds like we have introduced an unnecessary variable (this local printer) and should just cut them out of the process and deal directly with the overseas printer. The challenge is that the next step is for them to make a sample game for us, and at $1,000 a sample game, it's going to get crazy expensive if we have to go through several samples. I'll see if they can just run a single sheet of cards as a test run like you suggested.
    If the overseas printer sheet or sample game comes up with the muted color problem still, what steps happen next. I ask because I'm used to solving the issues and don't understand how to solve this one if it comes up again. Do I just tell them to "make it more vibrant" and they work their magic as professional printers, or is the expectation that I'm to go through each of our many illustrations and graphic designs and over-saturate them myself? I suppose we can cross that bridge when we get to it. It's just hard to work for 18 months on this game getting everything just right and now see this color issue that is out my hands that I cannot solve.
    For color space, I think I understand you. Most of our art is RGB.Our Proof Setup is "CMYK - US SWOP v2".
    Thanks again for the information.
    Tom

  • Ipad assistance needed for a previous jail broke ipad that has been restored

    How do you get itunes to recognize an ipad that was restored after a jail break?  I have held the home key and sleeper key and I have made sure itunes is on the most up to date version.  The ipad shows the sign to connect to itunes but when I attach it itunes does not pull up a device. I did a diagnostic and it tells me that there is no ipad, ipod etc attached

    Jail breaking and it's consequences are not supported by Apple or this forum.
    Seek help from the people who provided the jail break.
    Good luck.

  • Java 5.0 does not recognize wrapped Class-Path in Manifest.MF of .jar file?

    Java: build 1.5.0_05-b05
    Ant: 1.6.2
    I use Ant <jar> task to create a standalone application in a .jar file. I have a very long "Class-Path" in the Manifest.MF file. The long Class-Path is wrapped at every 70th character by the <jar> task. I cannot run "java -jar <the jar file>", because Java runtime cannot find classes.
    I found the following Q&A from ANT's FAQ page,
    Q: Whenever I use the Ant jar or manifest related tasks, long lines in my manifest are wrapped at 70 characters and the resulting jar does not work in my application server. Why does Ant do this?
    A: Ant implements the Java Jar file specification. Please refer to the notes section where it discusses the maximum allowable length of a line and the concept of continuation characters.
    If a jar file produced by Ant does not work in your appserver, and that failure is due to the wrapped manifest, then you need to consult your appserver provider, as it is a bug in their appserver. Far more likely, however, is a problem in your specification of your classpath. It is not Ant's wrapping of your classpath that is the problem.
    Do not raise a bug about this issue until you have checked to ensure that the problem is not due to your classpath specification.
    Any idea?

    "will be searched ALSO."...
    From: http://java.sun.com/docs/books/tutorial/ext/basics/load.html
    Understanding Extension Class Loading
    The extension framework makes use of the new class-loading mechanism in the JavaTM 1.2 platform. When the runtime environment needs to load a new class for an application, it looks for the class in the following locations, in order:
    1. Bootstrap classes: the runtime classes in rt.jar and internationalization classes in i18n.jar.
    2. Installed extensions: classes in JAR files in the lib/ext directory of the JRE.
    3. The class path: classes, including classes in JAR files, on paths specified by the system property java.class.path. If a JAR file on the class path has a manifest with the Class-Path attribute, JAR files specified by the Class-Path attribute will be searched also.
    [snip]

  • Who knows about Jar/Manifest: Class-Path-Attribute

    My question is:
    When packaging my classes and ressource files into a jar file, everything works fine as long as I put the manifest-file into the parent directory of the package folders (there's the main class too) and set its Class-Path-Attribut just as . (a dot).
    I'm working with WinXP Prof.
    As soon as I fill in a path with backslashes or slashes as separator, the produced jar-file doesn't work (class loader does'nt find main-class).
    Is the problem the drive-letter (D:) in the path or do you know something else?
    Greetings
    Frank

    Yes, and likely the . is what you need ...saying: I want the packages which begin in the same directory as the jar running this application. Even if your class is in a package hierarchy like tst.test.Support.class, if the directory tst is in the same directory as the application jar, you would use classpath . not tst/test/Support.class. If you put the tst package in a directory under the folder where the jar resides, say called testit ...you would then have a classpath in the mainifest like testit/. The class path always needs to get you to the root of any package you want to use ...but not into the package itself. Java recognizes when it is looking at a package nesting due to the package declaration syntax in the files, the classpath just points to the location of the root of that package and nothing more. Does this make sense?

  • Jar: Manifest-Attribute "Class-Path"

    I've got a problem with the Class-Path-attribute of the JARs manifest-file. So I've written a real simple application to test where the problems occure... but even this trivial app does not work!
    The execution starts at "Starter.java":
    public class Starter{
          public static void main(String args[]){
                packageOne.Caller.callWriter();
    }The class "Caller" is in a JAR ("Caller.jar") in the same directory as Starter.java.
    Caller.java:
    package packageOne;
    public class Caller{
          public static void callWriter(){
                packageTwo.Writer.write("Write this");
    }The class "Writer" is in a JAR ("Writer.jar") in the same directory as Starter.java and Caller.jar.
    Writer.java:
    package packageTwo;
    public class Writer{
          public static void write(String message){
                System.out.println(message);
    }The file Caller.jar consists of Caller.class and the Manifest.mf. The package-structur/the path seams to be all right.
    The file Writer.jar consists of Writer.class and the Manifest.mf. The package-structur/the path seams to be all right.
    If I invoke the Starter with:
    java Starter -classpath Caller.jar;Writer.jareverything's fine.
    Now, I added the following line to the Manifest.mf of Caller.jar:
    Class-Path: Writer.jar(with one empty line between Manifest-Version: 1.0 and the new line.
    So... shouldn't it be possible now, to invoke the application with:
    java Starter -classpath Caller.jar ???
    It doesn't work. So: what have I misunderstood?
    (The error message is:
    Exception in thread "main" java.lang.NoClassDefFoundError: packageTwo/Writer
          at packageOne.Caller.callWriter(packageOne/Caller.java:5)
          at Starter.main(Starter.java:3)

    Hmmm, I tested it and here are the command I ran and their results. Try doing the same on your computer:aleph% mkdir packageOne
    aleph% mkdir packageTwoThat created the directories.aleph% cat > Starter.java
    public class Starter{
          public static void main(String args[]){
                packageOne.Caller.callWriter();
    aleph% cat > packageOne/Caller.java
    package packageOne;
    public class Caller{
          public static void callWriter(){
                packageTwo.Writer.write("Write this");
    aleph% cat > packageTwo/Writer.java
    package packageTwo;
    public class Writer{
          public static void write(String message){
                System.out.println(message);
    }That created the source files: Starter.java in the current directory, Caller.java under packageOne and Writer.java under packageTwo. Next the compiling and creating the manifest file:aleph% javac Starter.java
    aleph% cat > MF
    Class-Path: Writer.jarThat created additional info to be included in manifest file and put it in a file called MF.
    Then I package "caller.jar" with the manifest and "Writer.jar" without it:aleph% jar -cmf MF caller.jar packageOne
    aleph% jar -cf Writer.jar packageTwoDelete the package* directories so java wont get confused...aleph% rm -r package*And finally run the thing. Remember that the path separator is : in unix but ; in DOS, if that is what you are using.aleph% java -cp .:caller.jar Starter
    Write thisNo problems anywhere. What are the steps you did?

  • Stand alone class and the class path

    Hi,
    I have a simple Java project in Eclipse environment. The project has it's class path,
    that contains a jar file that I need to use.
    The project runs perfect in the Eclipse.
    Now, I need to take the main class out of my project, to function alone in another environment.
    My problem is that out of the environment, I don't know how the class should know that classpath.
    I moved that jar to the same folder that the class located in, but I don't know how to tell it that the jar is there.
    My goal is to run my standalone class from another java class.
    I'm afraid that examples in command environment wouldn't help me.
    Thanks a lot for any help !

    moshi wrote:
    I have a simple Java project in Eclipse environment. The project has it's class path,
    that contains a jar file that I need to use.Ok, so you have a class that you have written that depends on an external library. Fair enough.
    The project runs perfect in the Eclipse.
    Now, I need to take the main class out of my project, to function alone in another environment.Maybe (just maybe!) defining what exactly that "other environment" is could help us help you.
    My problem is that out of the environment, I don't know how the class should know that classpath.Well, obviously that depends on what that other environment is.
    You must have some way to influence that other environments classpath, or you couldn't even get it to call/use your class.
    I moved that jar to the same folder that the class located in, but I don't know how to tell it that the jar is there.Now you're just guessing.
    My goal is to run my standalone class from another java class. That's simple enough, you probably do it all the time.
    I'm afraid that examples in command environment wouldn't help me.And why exactly is that?
    Do you realize that you tell us far too little about your problem for us to be able to actually help you?

  • Class path fully qualified vs offset

    I am invoking a JVM from a c++ application and I am having problems setting a fully qualified classpath. If I set the class path like the following, I get NoClassDefFoundError errors.
    stringstream classPath;
    classPath << "-Djava.class.path=/home/user1/application"
    << ":/home/user1/application/myjar1.jar"
         << ":/home/user1/application/myjar2.jar"
         << ":/home/user1/application/myjar3.jar"
         << ":/home/user1/application/myjar4.jar";
    But, if I set the class path as an offset from the directory in which I launch my application, everything works correctly.
    classPath << "-Djava.class.path=."
    << ":./myjar1.jar"
         << ":./myjar2.jar"
         << ":./myjar3.jar"
         << ":./myjar4.jar";
    The remaining code to set up the JavaVMOptions:
    JavaVMOption options[4];
    options[0].optionString = "-Djava.compiler=NONE";
    options[1].optionString = (char *)(classPath.str().c_str());
    options[2].optionString = "-Djava.library.path=.";
    options[3].optionString = "-Xmx1000m";
    Anyone have any similar problems?

    Actually, what I did is to copy (sprintf) the string
    stream's char * to a local char * variable. Then I
    set the classpath optionString equal to the local char
    *. Seems unecessary but it works.Not sure if that is a good idea but it depends on what you mean by "local char *".
    If you want to do a dynamic classpath then use one of the following..
    1. A global char array with a fixed (big) size.
    2. A global char pointer that you initialize to the size needed.
    With either of the above you can also use the string stream by passing in the array via the constructor.

  • Specify Main-Class to /bin folder inside Jar?

    I'd like to set the Main-Class of my runnable jar to use a class inside /bin INSIDE the jar
    this is because one of my packages's first folder is /gl and there is a /gl folder containing resources inside my jar's root dir... want to seperate those.
    Thanks!
    IE:
    Main-Class:bin/package.package.classname
    doesn't work, even if my classes are all inside bin.

    Make two jars, one for code, one for resources. Name the resource jar in the Class-Path of the first jar's manifest.
    The bin trick would not work.

  • Running a Java class which depends on a Jar

    Hi,
    I try to run a class using the command java packagename.classname.
    This class depends on a jar for functioning.
    So, when I run this class, exception related to the absence of this Jar is shown.
    How can I overcome this? Where should I place this jar or running any other commands for loading this jar will do?
    Please help.
    Any help in this regard will be well appreciated with dukes.
    Regards,
    Rony

    Hi Rony,
    Place the that jar file in your class path.
    or
    Place that "jar file path" in Enivronment Variables of your computer under "Class path" variable
    or
    set the class path using command prompt.
    Thanks,
    Sekhar

  • Manifest class-path does not works

    Hi,
    We use Jrockit 1.4.2 (latest) on Solaris.
    We found that manifest class-path does not seems to work, we got classdef not found messages.
    If we change the JVM to sun 1.4.2 that everything works perfectly.
    Manifest:
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.5.2
    Created-By: 1.4.1_02-b06 (Sun Microsystems Inc.)
    Implementation-Title: com.clarify.igb.common.ejbserver
    Implementation-Version: 12.5.000
    Implementation-Vendor: Amdocs Inc.
    Specification-Title: ClarifyCRM Business Object Infrastructure
    Specification-Version: 12.5.000
    Specification-Vendor: Amdocs Inc.
    Class-Path: ClfyShared.jar ClfyCbo.jar ClfyClient.jar ClfyWebInf.jar C
    lfyiSupport.jar ClfyUtil.jar jdom.jar ClfyCommon.jar ClfySales.jar Cl
    fymOrder.jar ClfyiAdmin.jar ClfyBilling.jar ClfyBillingManager.jar Cl
    fyEmailProcessor.jar
    What can be the problem?
    Regards.,
    LJ

    Hi Jaejun,
    a.jar should also have a MANIFEST.MF Class-Path refering to b.jar.
    HTH
    Regards,
    Slava Imeshev
    "Jaejun Lee" <[email protected]> wrote in message
    news:3e541ede$[email protected]..
    >
    I meant <CRLF> not <CR> only.
    Thank you.
    "Jaejun Lee" <[email protected]> wrote:
    Ravinder Pal <[email protected]> wrote:
    I have read all message posted in this regard but my problem still
    remain.
    Please read the context to give me some pointers.
    myapp.ear contains
    - myejb.jar contains
    - manifest with Class-Path a.jar b.jar
    - a.jar (Internal)
    - b.jar (Some external Vendor)
    Problem: Call from a.jar classes which reference b.jar classes doesraise
    a ClassNotFoundException.
    Thanks.
    I have a similar problem with WebLogic 7.0 sp1.
    I have to verify this.
    Dose WebLogic support MANIFEST.MF Class-Path in development-mode.
    Indeed, I just put a.jar and b.jar in application directory.
    I put Class-Path: b.jar<carrage-return> in MANIFEST.MF of a.jar.
    But, a.jar cannot find classes in b.jar.
    Do I have to make EAR?

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

  • Fat Jar Export: Could not find class-path entry for 'C:Java/jdk/mysql-connector-java-

    ok friends,
    have a normaly running project in eclipse and want to create a jar file...i tried ewerythin in ->export but nothing function
    i wanted to create a runnable jar file but that error ecures:
    JAR export finished with warnings. See details for additional information.
    Exported with compile warnings: ICQJJ/src/ICQJJ.java
    Jar export finished with problems. See details for additional infos.
    Fat Jar Export: Could not find class-path entry for 'C:Java/jdk/mysql-connector-java-5.1.8-bin.jar'
    what's the problem?
    ok, i am using a mysql db und using the driver mysql-connector-java-5.1.8-bin.jar....
    i improted this jar file like this run -> run configuration -> classpath -> add external jar....
    pls help me

    That looks like it might be a binary-distribution JAR that you should unjar. The actual JAR for the classpath is probably inside it.

  • How do I add the system classpath to Jar Manifest Class-Path

    My application is implemented on win2000 and need to be moved to unix as a executable jar file, the oracle jdbc classes (classes12.zip and classes111.zip) were included in MANIFEST.MF as the following:
    Class-Path: /Oracle/Ora81/jdbc/lib/classes12.zip /Oracle/Ora81/jdbc/lib/classese111.zip
    When I move the jar file to unix, the classpath will be changed, is there a way to make the jar file read the class-path from system CLASSPATH?
    Thank you.
    Y.

    I have the same problem for weeks now, and I can't seem to get it solved. If you found anything please inform me.
    thanks in advance
    Eran

Maybe you are looking for

  • Has Apple acknowledged a problem with v1.1 re:Video yet?

    Does anyone know if Apple has answered about the probs with v1.1 for video issues yet? Do they acknowledge that there is a probelm yet? Are they working on a fix? when will it be. I have held off at the mo with updating cheers LOC

  • JLabel Text merges into JComboBox - GBLayout bug?

    Hello, http://666kb.com/i/ayv9fbt03b8v1bkcy.png as you can see the text of the JLabel goes into the JComboBox, buy why? The Code looks ok to me: panel3.setLayout(new GridBagLayout());               addJComponentToJPanel( panel3,movieFormatLB       ,0

  • Item Category for a Product

    Hi All, I need to get the Item Category Group for a product. Are there any function modules to get this. Or else which database tables to look in for. Thanks, Smita

  • Monolingual question

    If anyone is familiar with the Monolingual program, I have a question. This great application was reccomended to me by someone on the board. I have used it to delete all the languages besides English from my machine. But there are also two other tabs

  • Capturing iOS video for trailers?

    Hi all, this didn't seem to be covered here (maybe I missed it). Just wondering about the best way to capture game/app footage from an iOS app to be used for trailers/promo use? The best way I can figure out is to do an Xcode build and use something