JAVA -jar manifest doubt

Hi
Recently downloaded JAXB binary code and and executed this jar as per the instruction. Inside the jar there was a Main.class and a manifest file under META-INF.
Contents of the manifest file were
Manifest-Version: 1.0
Main-Class: Main
After executing java -jar JAXB2_20110115.jar other library files (jars,htmls images) were installed in a new folder .
From where are these files retrieved. There is no classpath mentioned in the manifest file . As soon as i execute this the files are installed.
I understand that the Main.class is doing this job but not able to understand how? where are the new files retrieved coming from?
apologies for making it too long

user13534570 wrote:
I understand that the Main.class is doing this job but not able to understand how? where are the new files retrieved coming from?Either from the jar itself or over the network. My first guess would be the jar itself.

Similar Messages

  • Java -jar OrgFormatter.jar

    Hi All,
    I'm very new to Java. I'm trying to run this jar file and getting following error.
    java -jar OrgFormatter.jar VarshaTest060404.txt varshatest
    Failed to load Main-Class manifest attribute from OrgFormatter.jar
    OrgFormatter file takes two arguments <input file> and <output file>
    Please help me here.
    Thanks much
    Var

    if it doesn't work( the think is about the creating manifest file) you should study on the manifest files. I am wathching this topic

  • Java -jar Test.jar  option is not identifing the CLASSPATH on UNIX BOX

    Hi All,
    java -jar Test.jar
    I am trying to execute Test.jar file using -jar option. I am able to excute the Test.jar file but it is not identifing the CLASSPATH set for other JAR files which is used in part of Test.jar. Saying java.lang.NoClassDefFoundError: for the class which are set in CLASSPATH.
    The same is able to identify the CLASSPATH if i excute the Test.class file directly with out -jar option like
    java Test. In this case everything is working fine.
    Can any one tell me why it is not identifying the classpath if i use or execute with java -jar Test.jar option.
    Thanks,
    sha

    When you use the -jar option, the only classpath that is used is the Class-Path in the manifest file of the jar. If there is no Class-Path, then only the jar is searched for classes. If there is a Class-Path, the paths must be relative to the jar file.

  • Java -jar NewOW.jar

    Hello!
    I get an error when trying to run my apps jar ...
    Directory of F:\Documents and Settings\Richard\NewOW\dist
    01/17/2006  07:38 PM    <DIR>          .
    01/17/2006  07:38 PM    <DIR>          ..
    01/17/2006  07:38 PM           595,646 NewOW.jar
                   1 File(s)        595,646 bytes
                   2 Dir(s)  46,755,405,824 bytes free
    F:\Documents and Settings\Richard\NewOW\dist>java -jar NewOW.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: org/jdesktop/layout/G
    roupLayout$Group
    F:\Documents and Settings\Richard\NewOW\dist>I dont know what I need to check from this error
    runs fine in the IDE
    Thanks!

    Just as reported, Java can't find
    org/jdesktop/layout/GroupLayout$Group because
    you aren't providing it. You must place a copy in
    your NewOW.jar and create a Class-Path: entry in the
    manifest file.
    If your're going to use NetBeans, you really need a
    good understanding of classpath and jars, and what
    the IDE will do, and what you have to do.
    If you replace your NB beta version with the RC1
    version, it will do more for you.Running RC1 now ..... and jar run just great without me changing anything!

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

  • Java Jar compilation

    Hi all ,
    I have been busy with my work so could not enter into this forum,
    I am building a jar file of my project.
    I am using NetBeans IDE. My files uses an external Jar File a JCalendar bean.
    In NetBeans I was able to include it in the editor path.
    But now i want to run this jar from command prompt using java -jar option.
    But it is not recognising the external jar file JCalendar Bean. I have even included this in class path of system variables.
    Please tell me how to do this, my project is going to client side on sunday and i have to implememnt this tommorrow.
    Thanks in advance.

    Hi!
    Sorry, this weekend I was with my girlfriend.
    Above some links:
    http://java.sun.com/developer/Books/javaprogramming/JAR/basics/manifest.html
    http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html
    But basically you have to create a subdirectory called "META-INF" in the root of your application and put the MANIFEST.MF inside this subdirectory. You�ll have to define the property "Class-Path" in the MANIFEST.MF, putting the JAR files that your application need. Try to get some available and free JAR file, like struts.jar, open it, analise the MANIFEST.MF of this jar, and try to do similarly.

  • Linking external jar when starting java -jar problem

    Good day!
    A have a little program:
    import org.apache.log4j.Logger;
    public class CMDClient {
         static Logger log;
         public static void main(String args[]) throws Exception {
              log.info("test");
              System.exit(1);
    }I created a test.jar file, containing only this test class. When I start it by java -jar test.jar it cannot find linked (through import) Log4j library. Is there a way to link external jar to "jared" application?
    Good day!
    A have a little program:
    import org.apache.log4j.Logger;
    public class CMDClient {
         static Logger log;
         public static void main(String args[]) throws Exception {
              log.info("test");
              System.exit(1);
    I created a test.jar file, containing only this test class. When I start it by java -jar test.jar it cannot find linked (through import) Log4j library. Is there a way to link external jar to "jared" application?
    Good day!
    A have a little program:
    import org.apache.log4j.Logger;
    public class CMDClient {
         static Logger log;
         public static void main(String args[]) throws Exception {
              log.info("test");
              System.exit(1);
    I created a test.jar file, containing only this test class. When I start it by java -jar test.jar it cannot find linked (through import) Log4j library. Is there a way to link external jar to "jared" application?
    Error was: java.lang.NoClassDefFoundError

    There's a Class-Path attribute in the manifest.

  • When using java -jar does -cp have any significance?

    So we have a classpath that's set from the Manifest but I want to augment that with -cp
    From what I can tell -cp is ignored when you are using the classpath from a Manifest.

    >
    From what I can tell -cp is ignored when you are using the classpath from a Manifest.>No. The -cp option is ignored when using the -jar option.
    So if you do something like..
    REM: old way of launching
    REM: java -jar the.jar arg1 arg2
    java -cp the.jar;...;another.jar the.main.class arg1 arg2..it should work as expected.

  • Distribute Java jar application in Optical Disk with private JRE

    I am trying to ship my Jar application using DVDs and need the user just to run an exe and launch the program. So I have written a batch file which runs the jar using the private JRE shipped in the same DVD.
    Now when I run the batch file from the DVD it takes over one minute to launch the application because JRE is in the DVD as well.
    When I copy the JRE in hard disk and use that in my batch file to lauch the program it runs fast. However I wouldn't the path where the user copies the JRE in his hard disk. How would I detect the same in my batch file ?
    Even Launch4J takes same time as batch file.
    If I anyway have to ship JRE and ask the user install first ,how does batch file know the installed jre location if JAVA_HOME is not set. it would start using the jre in DVD and slow down. Anyway to make sure JAVA home is set to begin with ? May be 1st time if Java home is not set it copies to jre to C drive and then next time onwards it launches using the same Java home? What do you suggest
    [cross post |http://stackoverflow.com/questions/13372969/distribute-java-jar-application-in-optical-disk]
    Note I am using JDK8 , which is only developer preview now am I allowed to ship it in my DVD ?

    I wouldn't do that. Even if it is allowed, which I doubt, you're shipping unfinished and potentially dangerous software. I would also stick to the runtime only if I were you.I know, Sorry I meant shipping JRE only not JDK.
    My answer to your main question is: yep, its a tough problem and you're not going to crack it without special measures. One such special measure is to generate an installer using one of the many installer generators you can >find with Google.Yes I thought about installers but it would copy my jar and resource files to hard disk which I don't want to avoid piracy. Is there any way to access the rest of the files from DVD directly ?
    PS. My DVD vendor promisssed that he would burn them such a way that whole thing can't be copied to hard disk or imaged, I am yet to verify this.

  • Help.about "java -jar"

    execute "java -cp second.jar;main.jar main.Main", it is ok.
    but
    execut "java -jar -cp second.jar main.jar", it fails. It report that java can't find one class in second.jar. The second.jar is not any changed.

    if you use the -jar arg, then java needs to know which Main-class to run in the jar. You have to state this explicitly in the file 'Manifest.mf' which should be in your jar-file in the folder 'meta-inf'. In that file state the location of the main-class like this:
    Main-Class: package1.package2.MyMainClassName
    greetz,
    Stijn

  • Java -jar works, javaw does not

    I have a client who is unable to launch a jar from the desktop with javaw but if I type in the command line java - jar thejar.jar it works fine.
    They originally had jars associated with PKzip. I changed the program association (its an XP machine by the way). But neither double clicking nor the javaw command work.
    Whats the deal?

    Ya !!!!, the only deal is that is that u have to specify the manifest information inside the Jar file....
    One way ,
    inside ur Jar file , u may find Manifest.mt
    make the following arrangement ,,
    Main-Class: name of the main class that runs the Application ...
    save it in a text file called man.mtpor with any extension...
    then under commannd prompt,
    use jar -ufm jarname.jar man.mpt
    the manifest info will be saved into the jar file ,,
    To confirm that , make that jar opened in Zip and see the Manifest file ,, the attrb values are updated...
    Hence the deal is finished !!!!!!

  • JAR manifest and -Xmx

    Hello all,
    Could anyone please tell me is there any way to specify -Xmx parameter in JAR Manifest file?
    Regards,
    Vladimir Ikryanov

    Is it possible at all to set VM options from withinmanifest files?
    No.Ok, thanks. It's a pity, isn't it?
    I think I'll try Java Web Start. You can set VM options there as much as I know. And maybe I try to rewrite the app so that it uses less memory.
    Thanks for your answer again!
    -Puce
    Message was edited by:
    Puce

  • The Java JAR file "minecraft.jar" could not be launched.

    I just downloaded a new version of this game called Minecraft and it says: The Java JAR file "minecraft.jara" could not be launched. Check the console for possible error messages. I have checked the Console and it says: 
    15/10/2011 23:11:08 [0x0-0x1d01d].com.apple.JarLauncher[191] Failed to load Main-Class manifest attribute from
    15/10/2011 23:11:08 [0x0-0x1d01d].com.apple.JarLauncher[191] /Users/sabi1110/Desktop/minecraft.jar/minecraft.jar
    Help?

    How to Diagnose Jar File Problems
    Open Applications > Utilities > Terminal.app, and then type in the following:
    java -version
    java -jar <drag the minecraft.jar file here>
    Then press Enter. Copy and paste whatever error message appears.

  • Line Breaks in JAR Manifest

    I'm currently using a maven plug-in to generate a manifest file using the java.util.jar API. When creating attributes in the manifest, the plug-in inserts line breaks in comma-separated lists automatically to make the Manifest easier to read. When the manifest is written using Manifest.write(OutputStream), line breaks are added every 72 characters despite the fact that the attribute value already contains line breaks.
    Should this be reported as a bug or is there another way to format the manifest so that the line breaks don't destroy the readability.
    From the generated manifest:
    Bundle-ClassPath: lib\spring-beans-2.0.7.jar,
    lib\commons-logging-1.
    1.jar,
    lib\log4j-1.2.14.jar,
    lib\spring-core-2.0.7.jar,
    lib\spr
    ing-context-2.0.7.jar,
    lib\spring-dao-2.0.7.jar,

    Manifest lines must not exceed 72 bytes; see
    http://java.sun.com/javase/6/docs/technotes/guides/jar/jar.html#JAR%20Manifest
    Presumably Manifest.write could try harder to break at commas. You could file an RFE if this is really important and there's not already a similar issue.
    Thanks,
    Dave

  • Can not create i.war using java -jar ords.war static

    C:\glassfish4\ords>java -jar ords.war static "c:\app\sybrandb\apex_4.2.6\apex\im
    ages"
    WAR Generation complete
    WAR location     : C:\glassfish4\ords\i.war
    Context path     : /i
    Static resources : c:\app\sybrandb\apex_4.2.6\apex\images
    Ensure the static resources are available at path: c:\app\sybrandb\apex_4.2.6\ap
    ex\images
    on the server where the WAR is deployed
    I downloaded ORDS from OTN yesterday
    Needless to say this directory does exist (it works when I run the listener standalone, providing this path)
    Why is everything which Oracle releases in this area always broken and badly documented?
    HELP!
    Sybrand Bakker
    Senior Oracle DBA

    To create the manifest, you use the constructor
    JarOutputStream(OutputStream out, Manifest man).
    However, I am having problems with creation of my files and I came here to look for answers. No .war file i have created has been deployable.

Maybe you are looking for