I Can't Create my jar File

I have a package called voiceexpert which contains three classes: Disease, DiagnosingEngine and Symptoms which is a JavaBean. Symptoms makes use of Disease and DiagnosingEngine objects.
voiceexpert is stored in the directory: c:\diagapp3
I compiled Symptoms.java as below:
c:\diagapp3> javac -d . Symptoms.java
The class files for Disease.java, DiagnosingEngine.java and Symptoms.java are placed in the directory: voiceexpert.
I created a Manifest.txt file inside c:\diagapp3 containing the following:
Main-Class:voiceexpert.voiceexpert.Symptoms
Name:voiceexpert/Symptoms.class
Java-Bean:True
I later created the jar file with the command:
jar cfm jjj.jar Manifest.txt voiceexpert\*.*
But, I am having the error message: "*invalid header field*".
What can I do to remove this error?
Note: I created the Manifest.txt using utf-8 encoding. My code is to be used in a third-party application and that is why it does not contain a main method.
The link I was referred to could not help me. I need help please!
Edited by: Adeyi on Feb 24, 2010 2:26 AM
Edited by: Adeyi on Feb 24, 2010 2:34 AM

Adeyi wrote:
..I created a Manifest.txt file inside c:\diagapp3 containing the following:
Main-Class:voiceexpert.voiceexpert.Symptoms
Note: I created the Manifest.txt using utf-8 encoding. My code is to be used in a third-party application and that is why it does not contain a main method.Why are you specifying a main-class when the API has none?
The link I was referred to..What link? Just imagine for the moment that the Internet is a big place and we are not psychic.

Similar Messages

  • 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 can I create a jar file at a Unix systems?

    Hi there,
    how what's the command to create a jar file in Unix? I'm creating a zip file and then renaming it to jar, but it's size is smaller than the one when I use the WinZip tool at a Windows system.
    Thanks,
    Andre

    Oops,
    it very easy to do. Just use the jar -cvf command
    Andre

  • How can I create a jar file that will run automatically on double click

    all the jars I created run only from the command-line.
    how can I make it run by double-click on it?

    First you will need to associate .jar files with the javaw.exe program in order to just be able to double click on the jar and run it from within a windows explorer application. Next you will need to set the main class attribute of the manifest file. My understanding is that the value of this attribute is used by the launcher to know which class to load. In other words, which is your main application class. To specify this attribute open your manifest file in a text editor. You will find this file located within the jar at META-INF/MANIFEST.MF. Then, add the line,
    "Main-Class:<relative path to the main class>" However, remember not to add the .class extension to the end of the class name.
    In Windows 2000 you can associate jar files with javaw by finding a jar file in Windows Explorer and right clicking it. This will give you a context menu which should have an Open With... option (if you are not using Windows 2000 and don't see the 'open with' menu item, try holding down the shift button while right click on the file). Select the Open With... option, then, when the dialog appears highlight javaw and select the "Always use this program to open these files" checkbox. When you hit the OK button you should have all your jar files associated with the javaw process.
    Once you've done this, you should be able to double click on your jar file and run your application.
    Regards,
    Daniel Walsh

  • How to create a .jar file for the BPEL project

    hi all,
    how can i create a .jar file for my BPEL project, i am trying to deploy the project but getting an error :
    "Error: [Error ORABPEL-10902]: compilation failed [Description]: in "C:\OraBPELPM\integration\jdev\jdev\mywork\Workspace_BPELDemo\BPEL_Report\BPEL_Report.bpel", XML parsing failed because "". [Potential fix]: n/a. "
    and when doubel cliking on this error Jdev take me to the beginning of the ".bpel" file.
    I 'm really stuck in here i am not able to deploy the process!
    Thanks,
    Rana

    Rana:
    If you haven't already, I would post this question in the BPEL forum. I would expect a much better turnaround there.
    Johnny Lee

  • Help To Create a Jar File

    hi there
    i wanna create a exe file so i am trying to use jar file.
    I am new at creating jar files, my application has a main file and other java files, i am using other java files in my main file my concern is can i create a jar file including all the files and when i run jar file i want to complie java files, i really appreciate if anyone can help me out creating a jar file to compile and execute java files

    http://java.sun.com/j2se/1.4.2/docs/guide/jar/index.html

  • Creating a JAR File for a program that depends on other JAR files

    Hi, I'm pretty new to this so it shouldn't be terribly hard to answer:
    I have a program which uses JGoodies. There are 2 JGoodies .jar files in the same directory as my program. So I compile it by doing:
    javac -extdirs . NameOfMyProgram.java
    First off, is this the best way to do it? Is there any way of 'calling' these JAR files from within NameOfMyProgram.java?
    Secondly, if I then try to run it by doing java NameOfMyProgram, it doesn't work; can't find the JGoodies stuff. I end up having to add the classpaths of the unzipped JGoodies directories.
    So I have 2 questions:
    1. How can I execute my file so that it reads from the JAR files, not the big expanded folders that I unzipped?
    2. How can I create a JAR file that reads the JGoodies files properly? Right now, I have a Manifest.txt file that looks like:
    Main-Class: NameOfMyProgram
    Class-Path: forms-1.0.5.jar
    Class-Path: looks-1.3.1.jar
    Thanks a lot for your help!

    - learn how to use mysql JDBC
    - pack JDBC driver only
    - remotely access your DB
    - set proper security level for your app

  • Can Netbeans put a jar file In a jar file?

    I just went through the process of getting Eclipse to create a jar file that would execute from a command prompt using a plugin called fatjar :
    http://fjep.sourceforge.net/
    Details from other thread :http://forum.java.sun.com/thread.jspa?threadID=5219638&tstart=0
    I really would like to use netbeans but i now have the exact same problem trying to make a jar file in netbeans 5.5.1
    I am using a package from icaste.com It has a
    .dll file to put in the windows directory
    JCommSerial_3_0.jar file that contains all the classes
    I can compile and run a file in the IDE and it works fine
    The Jar file does not contain the classes so i get errors when running from command line.
    Here is the layout of my screen and result of run command in IDE
    http://www.acousticlights.com/netbeans.png
    What do I need to try?

    georgemc wrote:
    Why is everyone so obsessed with doing this? The gains are minimal and the problems numerousBecause we are new and don't understand how the java VM actually runs code and the error messages sent by the java machine are cryptic.
    My first attempt at using an external jar in a java program lead me to believe that all of the code for a java program would be in a jar file including external jar files, after all the JDK standard library has tons of jars in it so I assumed the external jar file would be linked (as most other programming compiler/linkers I have worked with in my top down programming life).
    I find out the answer is so simple that the external jar file could not be found by the VM running my jar file. Like I said, if the VM would have just gave me an error that it could not find a file on a specific directory i never would have perused the idea of jar in a jar (fatjar plugin for Eclipse for example)
    Really this is like getting into a race car and not knowing at what RPM to shift gears, sure you can press the pedal and make it go but if you don't understand how it works under the hood you are going to blow the engine if you keep it in first gear.
    I have read many posts on these errors, the reason is the error message is just not very descriptive of the original problem. If I try and open a database called xyz.dbf that has one field defined as lastname, in C for example, I would not give the error message "Lastname could not be found) when indeed the lastname could not be found but the reason it could not be found was because the database xyz.dbf could not be found. Further , adding to the error message that the system is looking for xyz.dbf on drive X- subdirectory -mydatabases would complete the error message and allow the user to fix the error. Just what is a non java programmer that is using my java program suppose to do with an Ecception Error in (main) bla bla bla... I know now I need to check for library files myself within my own java programs and give a better error message to the user before the java VM sends out it's cryptic message.
    Edited by: metron9 on Sep 25, 2007 11:00 AM

  • 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 create a .jar file in wlcs3.1

    hello friends,
    hi friends, im working on weblogic commerce server3.1 . i dont know how to create a .jar file in weblogic commerce server3.1. can any one knows send email to me.
    thanks.
    hari

    $JDK_HOME/bin/jar (%JDK_HOME%\bin\jar) shows you the syntax
    where JDK_HOME is your jdk installation directory.
    Kumar
    hari wrote:
    hello friends,
    hi friends, im working on weblogic commerce server3.1 . i dont know how to create a .jar file in weblogic commerce server3.1. can any one knows send email to me.
    thanks.
    hari

  • How to create a jar file which is in the remote system?

    Hi,
    I have a set of files that resides in a remote system,which have to be "jar"red. I have a firewall in between. I want to create a jar file out of the files situated in the remote system.How do i go about this process.?

    Hi,
    You can't do that in a simple way. You need to have a port open in the firewall, and you need to have a server process on the remote machine.
    Kaj

  • Can't create a .war file....

    Hi,
    I feel a little stupid but I can't create a .war file.
    I'm under the folder tuto which contains WEB-INF and index.html
    and I write this instruction on the command line:
    C:\tomcat\tuto>jar -cvfM ../tuto.war
    Unfortunately, it's not accepted.
    Can you help me please?
    Thanks in advance,
    Steevy.

    Hi,
    Thanks for your response.
    In fact, it doesn't change anything to remplace ../tuto.war by ..\tuto.war.
    I suppose the root cause isn't at this level because when I write just the following
    C:\tomcat\webapps\tuto>jar -cvf tuto.war
    I obtain exactly the same message:
    Usage: jar {ctxu}[vfm0M] [jar-file] [manifest-file] [-C
    Options:
    -c create new archive
    -t list table of contents for archive
    -x extract named (or all) files from archive
    -u update existing archive
    -v generate verbose output on standard output
    Best,
    Steevy.

  • Create a jar file using the jar tool

    Hello all,
    can somebody help me with this situation:
    I use the following comand
    jar cfm Seti.jar manifest.mf SetiSeti.jar is the name of the file I want to create and Seti is the name of the folder where I have the class files, the manifest file and the Seti.java. The manifest file is also out of this folder (exactly the folder were I use the command on the command line).
    After creating the jar... I try to run it but it gives an error message: "can't find the main class..."
    The content of the manifest file is:
    "Manifest-Version: 1.0
    Main-Class: Seti
    I'd never created a jar file before and have already read all the usefull information here and at sun... I'm very preoccupied with this..
    Can you help?
    Thanks

    RuiAranhaJava wrote:
    How do I do this?
    "And you have to name that package as well when you name the main class in the manifest. "
    But, as I have told the name of the package is SetiNo, you just told us that the name of your class is Set. You never told us about the name of the package.
    Simples question possible: Does your class look something like this:
    package Seti;
    // maybe there are some import statements here, maybe not
    public class Seti {
      // maybe there's something here, maybe not
      public static void main(String[] args) {
        // anything
    }If so, then the fully qualified name of your class is "Seti.Seti" and you need to write that into the Main-Class attribute. (*)
    If there is no package-Statement, then the fully qualified name of your class is simply "Seti" and the Main-Class attribute is correct, but your classes are in the wrong place.
    Edit:
    (*) Please note that package names should generally be all-lowercase, so it should be "seti" instead of "Seti". This helps distinguish it from the simple names of classes, so it's easy to see what you are talking about at a glance: "seti" would be the package, "Seti" the class name.

  • A program that creates a JAR file

    Hello,
    I want my program to generate a JAR file with the content of a folder, by I just don't know how to to this.
    I don't find any help about this and I wonder if it is possible.
    Can someone help me ?
    Does someone know if it is possible to create a jar in a program, and if yes, how to do ?
    Thanks a lot
    Lio

    (I think Lio wanted to create a .jar file in his program, rather than an external program that could create files for him?) The java.util.jar package has classes for creating jar files. They are quite easy to use. You can use this code as a reference:
    http://javaalmanac.com/egs/java.util.zip/CreateZip.html
    (nevermind the fact that the code creates a Zip file rather than a Jar file; the API is so similar you can just replace every occurence of 'zip' with 'jar')

  • Create a jar file

    Hello everybody! :) I really need your help.
    I have Tom.class
    I want to create a jar file.
    I use eclipse, so I created jar file there. I got MarkTven.jar in which:
    Tom.class
    .project
    .classpath
    MATA-INF / MANIFEST.MFin MANIFEST.MF:
    Manifest-Version: 1.0
    Main-Class: Tomclicking at MarkTven.jar I get:
    Invalid or corrupted jar file.Help me please.
    Message was edited by: ghost:))

    I have to say, that although this has nothing to do with me, I'd like to pass some comment. This attitude is prevalent throughout the forums and how can people be expected to gain experience if their efforts will be down-played and you try to make them accountable for their ignorance? It's a contradiction in terms. This is a large forum with more than a lifetimes worth of reading for those of us with a life.
    America70 has given you all the information you require to develop a resolve. I think he/she was depending on you perhaps being aware of a common issue he/she may have overlooked. I would treat that as misplaced respect personally, however, you could have steered him/her towards passing you further detail of his/her issue so that the issue could be resolved. Instead, this query remains, pointlessly, filling up space and uselessly guiding other new leaners no-where.
    You guys may be offering your advice for 'free' but you are also advocates for the language in doing so. Surely you should be making greater efforts to promote the language instead of forcing people to steer clear of attempting to expand their knowledge? It's just an opinion...
    *free - I use this term loosely because the cost to the learner is far from free, the expense being the mentors ego.
    In reference to the above post, America70 had simply made a typo in his/her query to you, not mis-spelt it in his/her implementation; he/she explained that. If he/she is required to add more detail, then politely ask him/her to. America70 also pointed out that he/she had followed the tutorial. It is obvious he/she has mis-read, mis-understood, or badly-impemented something. He/she has obviously overlooked this and is unable to discover the fault. It's not rocket science. If you people can't positively add to this post then what is your use as a helper/teacher?
    Edited by: chewzLife on May 18, 2008 7:50 PM
    Edited by: chewzLife on May 18, 2008 7:51 PM

Maybe you are looking for