Problems creating a jar executable file...

Hi there, I am new to these forums, my name is Jay.
I am trying to create an executable .jar file for my program I created in JBuilder 2005, with java files and several other files as well. I am having MAJOR problems with either the main class not being found or failing to load Main-Class manifest attribute.
I tried to make a .txt with two lines, including the first with the MAIN-CLASS: className and stuff and a second line blank, and use the cmf command line to run it and include it in there. I ran it and created it no problem, but then I try to run it, and I get the error of the main class not being found and I have specified the correct directory and class name.
Then I try to make my own manifest file with the correct directory and class name by making a txt file into an .mf file and when I try the cf command line this time, it gives me the error of failing to load Main-Class manifest attribute.
I have even followed the tutorials on the Sun developer website including Manifest making and stuff and everything.
I have worked on this program (java) for months and I am now STUCK. If someone could maybe give me some assistance or suggestions as to what my problem might be, I would greatly appreciate it so much. Or if you want, you can e-mail me, @ [email protected] with suggestions. Thank you all very much.
I have a folder in a directory. It's called SuperPassword, which is the folder where my project files and EVERYTHING is. my .class files are in the classes/superpassword subdirectory of the folder SuperPassword, my java files are in the src/superpassword subdirectory and my manifest file and txt files are in the SuperPassword main directory. Maybe that could give you guys a bit of a hint as to what I am dealing with, I want to explain it as clearly as possible.
Jay

I have a folder in a directory. It's called
SuperPassword, which is the folder where my project
files and EVERYTHING is. my .class files are in the
classes/superpassword subdirectory of the folder
SuperPassword, my java files are in the
src/superpassword subdirectory and my manifest file
and txt files are in the SuperPassword main
directory. Maybe that could give you guys a bit of a
hint as to what I am dealing with, I want to explain
it as clearly as possible.
JaySo I guess you have a directory path SuperPassword\classes\superpassword and the .class files are inside. Are the classes in a superpassword package? If they are, then the Main-Class must be something like "superpassword.MainClass" and when you jar the .class files you need to make sure they are in a superpassword directory inside the jar - like "jar cmf thejar.jar themanifest.txt superpassword\*.class"
You can check the directory structure by displaying the contents of the jar using "jar tf thejar.jar"
Also, remember that java is case sensitive.

Similar Messages

  • Export jdeveloper as jar executable file

    hello, I have a simple application developed using jdeveloper which access an oracle database and retrieve data. I would like to export this application as jar executable file. how can I do this using jdeveloper.
    Best regards

    Add a manifest file that identifies the main class. If you have questions on how to do that using your IDE, I suggest you hit 'F1' or visit a forum that deals with that IDE.

  • Problems creating a Jar-file

    Hello together!
    I have an application working perfectly, but now I want to create a jar-file.
    I created it in eclipse using Export and got the followint error message:
    Failde to load Main-Class manifest attribute from PATH.
    The I changed the manifest.mf and added the following line:
    Main-Class: MyMainClass
    and then I got the following error:
    Invalid or coorupt jarfile.
    If anybody knows what is the problem pls let me know.
    Thanks a lot.

    I am trying to use ant, and I have the built.xml file.
    But when I create the jar file I still have the same problem.
    So my question is how can I make the jar-file inlcuding the ant.
    I mean I did I think the pc created a export.jar, but the same problem.
    Does anybody know how to create a jar file (in eclipse)
    I would really appreciate any kind of help.
    Thanks

  • Including images in jar executable files. Using images in jar files.

    Does anybody know what is the reason of my problem??
    I created a package called test in my eclipse env. and in that package I placed folder named graph in which there is a file Help.png.
    Here is all the code I run in eclipse and it runs properly. When I create a jar file (using eclipse wizard) to execute without eclipse it can not execute and shows nothing (process starts and I have to kill it by myself in OS). Maybe there is some mistake with making jar... I do not know
    So let someone try tu run my class or build jar file and try to execute and share his observations (solutions) ??
    package test;
    import java.awt.Toolkit;
    import javax.swing.ImageIcon;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.UIManager;
    public class TestWindow extends JFrame {
         private JButton jButton1 = new JButton(new JARImage().getImage("Help.png"));
         public TestWindow() {
              this.getContentPane().add(jButton1);
              this.validate();
              this.setVisible(true);
         private class JARImage {
              protected ImageIcon getImage(String imageName) {
                   ImageIcon image = new ImageIcon();
                   try {
                        image.setImage((Toolkit.getDefaultToolkit().getImage(getClass()
                                  .getResource("graph/" + imageName))));
                   } catch (Exception ex) {
                        System.out.println("Image Error: " + ex);
                        ex.printStackTrace();
                   return image;
         public static void main(String[] args) {
              try {
                   UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
              } catch (Exception e) {
                   e.printStackTrace();
              new TestWindow();
    }

    Uncaught error fetching image:
    java.lang.NullPointerException
         at sun.awt.image.URLImageSource.getConnection(Unknown Source)
         at sun.awt.image.URLImageSource.getDecoder(Unknown Source)
         at sun.awt.image.InputStreamImageSource.doFetch(Unknown Source)
         at sun.awt.image.ImageFetcher.fetchloop(Unknown Source)
         at sun.awt.image.ImageFetcher.run(Unknown Source)

  • Creating a JAR executable

    I made a simple calculator in java and I want to zip it up in an excutable jar file. I have 3 classes including my main in my .java file and am having trouble creating the jar archive. The source code for this program is:
    import java.awt.*;
    import java.awt.event.*;
    import java.io.File;
    import javax.swing.*;
    // Frame for button panel
    class CalculatorFrame extends JFrame
         public CalculatorFrame()
              Toolkit kit = Toolkit.getDefaultToolkit();
              // sets title & icon image for window
              setTitle("Java Calculator v1.0 by D. Burkland");
              Image img = kit.getImage("calc.gif");
              setIconImage(img);     
              // add panel to frame
              CalculatorPanel calculator = new CalculatorPanel();
              add(calculator);
              pack();
              // centers frame
              Dimension screenSize = kit.getScreenSize();
              int screenHeight = screenSize.height;
              int screenWidth = screenSize.width;
              // center & set dimensions of frame
              setSize(width, height);
              setLocation(screenWidth / 3, screenHeight / 3);
              // set file chooser
              chooser = new JFileChooser();
              chooser.setCurrentDirectory(new File("."));
              // set up menu bar
              JMenuBar menuBar = new JMenuBar();
              setJMenuBar(menuBar);
              JMenu filemenu = new JMenu("File");
              JMenu helpmenu = new JMenu("Help");
              menuBar.add(filemenu);
              menuBar.add(helpmenu);
              // action of the exit text
              JMenuItem exitItem = new JMenuItem("Exit");
              filemenu.add(exitItem);
              exitItem.addActionListener(new
                        ActionListener()
                             public void actionPerformed(ActionEvent event)
                                  System.exit(0);
              JMenuItem helpItem = new JMenuItem("About");
              helpmenu.add(helpItem);
              helpItem.addActionListener(new
                        ActionListener()
                             public void actionPerformed(ActionEvent event)
                                  JOptionPane.showMessageDialog(null, "Java Calculator By: D. Burkland Summer 2006");               
         public static final int width = 350;
         public static final int height = 200;
         private JFileChooser chooser;
    // Calculator panel
    class CalculatorPanel extends JPanel
         public CalculatorPanel()
              setLayout(new BorderLayout());
              result = 0;
              lastCommand = "=";
              start = true;
              // add the display
              display = new JButton("Hello");
              display.setEnabled(false);
              add(display, BorderLayout.NORTH);
              ActionListener insert = new InsertAction();
              ActionListener command = new CommandAction();
              // adds the buttons in a 4 x 4 grid
              calculator = new JPanel();
              calculator.setLayout(new GridLayout(4, 4));
              addButton("7", insert);
              addButton("8", insert);
              addButton("9", insert);
              addButton("/", command);
              addButton("4", insert);
              addButton("5", insert);
              addButton("6", insert);
              addButton("*", command);
              addButton("1", insert);
              addButton("2", insert);
              addButton("3", insert);
              addButton("-", command);
              addButton("0", insert);
              addButton(".", insert);
              addButton("=", command);
              addButton("+", command);
              add(calculator, BorderLayout.CENTER);
         Adds a button to the center panel
         @param lable the button label
         @param listener the button listener
         private void addButton(String label, ActionListener listener)
              JButton button = new JButton(label);
              button.addActionListener(listener);
              calculator.add(button);
         // Inserts the button action string to the end of the display
         private class InsertAction implements ActionListener
              public void actionPerformed(ActionEvent event)
                   String input = event.getActionCommand();
                   if (start)
                        display.setText("");
                        start = false;
                   display.setText(display.getText() + input);
         // Executes the command that the button action string demotes
         private class CommandAction implements ActionListener
              public void actionPerformed(ActionEvent event)
                   String command = event.getActionCommand();
                   if (start)
                        if (command.equals("-"))
                             display.setText(command);
                             start = false;
                        else
                             lastCommand = command;
                   else
                        calculate(Double.parseDouble(display.getText()));
                        lastCommand = command;
                        start = true;
         // Carries out the pending calculation
         public void calculate(double x)
              if (lastCommand.equals("+")) result += x;
              else if (lastCommand.equals("-")) result -= x;
              else if (lastCommand.equals("*")) result *= x;
              else if (lastCommand.equals("/")) result /= x;
              else if (lastCommand.equals("=")) result = x;
              display.setText("" + result);
         private JButton display;
         private JPanel calculator;
         private double result;
         private String lastCommand;
         private boolean start;
    public class Calculator
         public static void main(String[] args)
              CalculatorFrame calculator = new CalculatorFrame();
              calculator.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              calculator.setVisible(true);
    }I am using Eclipse to create the jar files so if anybody has any advice I would be very grateful if you shared it.
    Thanks,
    Danny

    Well I keep getting errors so I am doing something wrong. The errors I get are:
    java.io.FileNotFoundException: jarexample.jar (The system cannot find the file specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:
    106)
    java.io.FileInputStream.<init>(FileInputStream.java:66)
    at sun.tools.jar.Main.run(Main.java:122)
    at sun.tools.jar.Main.main(Main.java:903)So I have 3 classes, but after compiling the program I have many .class files: Calculator.class, CalculatorFrame$1.class, CalculatorFrame$2.class, CalculatorFrame.class, CalculatorPanel$CommandAction.class, CalculatorPanel$InsertAction.class, and CalculatorPanel.class. Which files do I want to export into my jar file and do I have to open these class files in Eclipse? Also could you explain the manifest thing first, I have googled for this stuff but get confused because of the class file issue that I previously stated.
    Thanks again for helping a noobie out :)
    Message was edited by:
    danny9894
    Message was edited by:
    danny9894

  • How to create a single executable file in oracle 10g

    hi all
    i am a fairly new user to oracle. i would like to know if there is any way that i can compile both the database and forms that i have created, using the oracle 10g developer suite, into a single executable file and be able to install it on another system without installing the development environment?
    can anyone please help
    thanks in advance

    Hi there
    The forum software was upgraded a few months back and many links to older content were lost.
    There are possibly a few different things you need to do. First, click Project > Skin > Borders tab and DE-select the "Show Borders" check box. That will eliminate the _skin.SWF from the mix. If you have full motion clips you may need to take other steps.
    Also note that while turning off the borders eliminates the _skin.SWF, it also has the side effect of coaxing the the playback controls up onto the main part of the presentation. If you don't like this, you need to resize the movie to make room for the playback controls to be placed into its own area.
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • Problem creating an jar file!

    Hello.
    I am trying to create an executable jar file using the following command:
    jar cmf MANIFEST.MF game.jar *.classHowever, I keep receiving the following error:
    java.io.FileNotFoundException: MANIFEST.MF (The system cannot find the file spec
    ified)
            at java.io.FileInputStream.open(Native Method)
            at java.io.FileInputStream.<init>(FileInputStream.java:64)
            at sun.tools.jar.Main.run(Main.java:124)
            at sun.tools.jar.Main.main(Main.java:904)Why am I getting this error and how can I correct this?

    Did you create a file called MANIFEST.MF? Is it in the same directory you are in now?
    And by the way, according to what I see when I run the jar command, you need to specify the jar file first, and then the manifest file:Usage: jar {ctxu}[vfm0Mi] [jar-file] [manifest-file] [-C dir] files ...
    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
        -f  specify archive file name
        -m  include manifest information from specified manifest file
        -0  store only; use no ZIP compression
        -M  do not create a manifest file for the entries
        -i  generate index information for the specified jar files
        -C  change to the specified directory and include the following file
    If any file is a directory then it is processed recursively.
    The manifest file name and the archive file name needs to be specified
    in the same order the 'm' and 'f' flags are specified.
    Example 1: to archive two class files into an archive called classes.jar:
           jar cvf classes.jar Foo.class Bar.class
    Example 2: use an existing manifest file 'mymanifest' and archive all the
               files in the foo/ directory into 'classes.jar':
           jar cvfm classes.jar mymanifest -C foo/ .

  • Problems creating a jar file with eclipse

    "posted as well on the eclipse forum but who knows maybe some of you had same issue before"
    Hi Developers.
    My issue is this, i have some java files which i would like to export and use as .jar files.
    All files contains classes, the files all ends with .java extention and are contained into a java project.
    I've seen the Eclipse tutorial for this case which advise to use:
    Click on project>Export>java>jar file>Save as("verkiezingen")>Location("desktop")
    Indeed it seems successfull as i see on my desktop the .jar file and while exporting the final dialog box does not tell me "exported with warnings"
    I then try to import the jar within a project like so:
    Right click on project>Build Path> add external jar's>select jar
    all good so far as i see the new item "Referenced package" under the usual "JRE system library"
    If now, within the project i create a new class and start with import.verkiezingen;
    it gives me an error message saying "The import verkiezingen cannot be resolved"
    cant understand why, if i open the jar from the "Reference package" the classes are there.
    I will paste the code of a class within the project i've tried to export initially as jar.
    code:
    public class StemmachineException extends RuntimeException {
         public StemmachineException(){
              super();
         public StemmachineException(String s){
              super(s);
    code:
    Thank you guys

    does the class have a package 'verkiezingen'? I don't see the package statement in your source listing.
    For that matter, is the class in a subdirectory 'verkiezingen' inside the jar?
    btw 1: use code tags when posting code to prevent the forum from swallowing certain characters, and to make it far more readable
    btw 2: boooooo to non-English class names :( I hope you don't get coworkers that don't speak Dutch.

  • How can i create a jar executable archive

    I could not find the way to create an executable archive from Oracle JDeveloper 10.1.3.3.0 .
    I have an application and a project with many packages that i want to archive.
    If somebody could help please .

    Well i red somewhere that It is also possible to make an archive that can be executed (run) by Java and even by a double click through your OS, if you have it set up correctly and that is what i want to do , a jar file which embraces all my packages and run a specified Main class.

  • Problem Creating PDF with Multiple Files in Pro. 7

    I'm using Adobe Acrobat Professional 7 on a computer with Windows XP.
    The problem is that when I try to create a PDF with multiple files everything just suddenly stops. There are 75 files involved and when it gets to around 41 or so (don't know the exact number because I turned away from my computer for just a moment), it just stops. There are no error messages; nothing. Just a blank Acrobat screen.
    Last week I had a different problem which was resolved by an uninstall/reinstall and I was able to create the PDF with those exact same 75 files, but after the PDF was created I realised that some changes needed to be made. I dumped the PDF, made the appropriate changes and left it for the weekend. Today I the new problem has arisen.
    Any ideas what the problem might be?

    I've read many discussions about Acrobat and problems with server files, with the general solution being what you are doing... copy the files to a local hard drive

  • Problem creating pdf from multiple files

    Hello,
    I'm running Windows XP SP3 with Adobe Acrobat Standard 8.2.1.  When I try to create a one pdf from multiple files in Adobe Standard 8.2.1 the application just closes.  The two files I'm trying to combine into 1 pdf file are word files.   I'm able to create a single pdf of each word file by opening them separately in word and sending them to the acrobat printer.  I've tried combining other files also, but had no luck.  Windows events doesn't log anything under applications and no error message pops up when the application closes.
    Anybody have any ideas how to troubleshoot this issue or what could be causing the applicaton to just close? 

    I've read many discussions about Acrobat and problems with server files, with the general solution being what you are doing... copy the files to a local hard drive

  • Problem with creatin jar & jad files(wtk 1.4.2)

    Hi,
    Im devlopping an application & im facing big problem:
    The application is runing normaly when i build & test it on wtk1.4.2,but when
    i create package (project-->create package) and go to test the jad im getting
    a black screen instead of my application.
    Can any one help.
    Thanks.

    i face the same problem!
    help me too!
    The application is runing normaly when i build & test it on wtk2.2 ,
    when i create package (project-->create package) and go to test the jad , the first screen can be display normally, but the second screen can not be display!
    my jar size :187K, is it too big?(it is a game.)

  • Newby problem - creating dvd from .wmv file

    First - thank everyone/anyone in advance for helping me. Second - is there a basic video how-to somewhere to help me learn Premiere Elements? I am finding this program very hard to figure out on my own.
    Here's the current problem - I created a slideshow with an audio track (a little music video) in Photoshop Elements 7, a .wmv file that I successfully uploaded to YouTube.  The file is 50k KB, under 5 minutes.
    Copied the wmv file to a DVD.  When my Sony HDMI CD/DVD player said it couldn't play the disc, decided to try something else.
    Imported the wmv file into Premiere Elements 7. Gave up trying to figure out how to create a title card, menu, etc, and since the video is just how I want it anyway, saved the file and tried burning it to disc.
    Put in a Verbatim Lightscribe DVD+R disc, 4.7 GB, and prepared to burn from PE7.  The program said that the disc status was not blank - which it is, so I burnt to a folder on my hard drive instead - 4.7GB, according to the choice I made from the program.  From the folder, I burned the Video_ts file to the disc.  It still doesn't play in my DVD player.
    I have reformatted the DVD to start fresh and make sure it is blank, but PE7 continues to read it as not blank.  Tried putting in a fresh disc newly opened, but the computer seems to format it automatically and still claims it is not blank.  Regardless, it is blank.
    What am I doing wrong and how can I properly burn this little video to a DVD?  Just trying to show my grandmother the video.
    Am working on HP HDX Premium laptop with Vista.
    Thanks for any advice.  I'm in and out so may not respond promptly.

    Elyse19
    There is so much to be looked at in Photoshop Elements 7 and Premiere Elements 7, used as standalone or intergrated.
    I like to look at the Help PDF under the Help Menu of each and follow through from "Getting Started" and onward.
    When you create a slideshow in Photoshop Elements 7, the preferred route to the DVD-VIDEO generated by Premiere Elements 7 is via Photoshop Elements 7 Slideshow Editor Output Option "Send To Premiere Elements". Once the slideshow (in a video form) arrives on the Premiere Elements Timeline, you then have an opportunity for further edits (if you want to) using the "Break Apart Adobe Photoshop Elements Slideshow" Command (right click video on Timeline and select that command).
    In Premiere Elements 7, you can burn your slideshow to disc (DVD-VIDEO Format on DVD disc). It is important to remember that the player has to support the disc type as well as the format on that disc. Try using a different brand type and/or disc type like DVD-R and see how you do. If you burn to folder, you burn just the VIDEO_TS (all files) housed in the saved folder, using a Burn Video Images category in the 3rd party burn software such as Nero, Record Now. Do not use Make Data Disc, a common mistake. The "playable disc" category mentioned in an earlier thread is sort of a functional name rather than the category name you will find in most of these 3rd party burn softwares. If you need a step by step for Nero or Record Now, I will supply that on request.
    But, you have a .wmv version of your slideshow that you want to get into DVD-VIDEO format on a DVD disc for playback on the TV.
    This is my suggestion:
    In Premiere Elements 7, after import to Timeline, Create Menus...
    Share/Disc/Disc
    Preset: NTSC Standard or Widescreen or PAL equivalent, depending on your location
    check mark next to "Fit Content to Available Space"
    Disc Type: DVD-R (never used before disc, out of the box)
    OR
    In a software such as Nero, Record Now
    Use Burn Video Files to DVD category to burn the VIDEO_TS folder to a DVD-R disc
    OR
    Use ImgBurn software (free download software which I find extremely "strange", but it works http://www.imgburn.com/)
    Follow instructions for burning the VIDEO_TS to a DVD-R disc
    ATR

  • Create and deploy executable file

    I'm very new to java. I've finished an application, and it runs fine on my develop machine. However, still I can not figure out how to create an executable application, so I can deploy on my clients' machine. Can anyone show me where to go to look up for the information how to create it and how to deploy it? A quick example is very appreciated.
    Thanks.

    There is a super program out there that does it all for you and you can even set the icon. It is really easy to use - i could do it and is intuitive in the instal for your users. Search for "InstallAnywhere" (the name of the program) and you should find it. Hope it helps.

  • JAR Executable works in netbeans but not under Dos?

    Hi all,
    I have created a jar executable and it works fine in netbeans(it was not created in netbeans) but I can't get it to run on the command line. If I type java ClassName.MainClass it will run but not using the command java JarFile.jar or java -jar JarFile.jar
    Any help would be most appreciated.

    When creating the manifest file did you add a carriage return at the end of the manifest? e.g.
    Main-Class:Hello.class
    (carriage return here on new line)
    I think it runs into problems if you dont add a carriage return ( a new blank line after manifest).
    Hope this helps
    Riz

Maybe you are looking for

  • Send a Single Mail with Multiple Attachment

    Hi Every One, SO_DOCUMENT_SEND_API1 is the function Module used  to send a file as attachment with the mail.My requirement is to send more than one file as multiple attachments in the same mail. Is this Possible? and How? Regds, Rajeev.N

  • Help printing from iPad to HP printer

    Im trying to print from my iPad 3 to an HP officejet 6500 wireless. I don't own a Mac so is there any other way to do this without of course having to buy an AirPrint? From everything I have read to install printopia I need a Mac. What are the HP mod

  • Problems with new Motorola SB6120 modem and BEFW11S4

    I upgraded to Charter Communication's high-speed Internet and after a couple of weeks purchased the SB6120 modem to replace my old SB4100 as the speed was progressively dwindling.  I cannot get my BEFW11S4 v2.0 router to work with the new modem.  I h

  • Missing Spartan3E_Read32VI.vi for homework

    Hi guys! I´m trying to run the digital filter (the last one) example from the LabVIEW FPGA Module Training for Xilinx Spartan 3E XUP Hardware and when I try to open the ADChost.vi I got an error that says "Open the VI named Spartan3E_Read32VI.vi"  a

  • Trouble opening premiere elements 12

    evry time i double click the application, it keeps on showing a message "unfortunately adobe premiere elements 12 has stopped working" why does this keep on happening? please explain this to me as simple as possible.