Results 1 to 7 of 7

Thread: How to create manifest.mf and jar files in java

  1. #1
    Join Date
    Jan 2010
    Posts
    126

    How to create manifest.mf and jar files in java

    Hello,
    My question will sound silly but the jar was created from eclipse does not work.
    Error was
    Code:
    Could not locate main class ...
    I know the question is stupid and I'm sure it's just stupid to pay but I find it alone as a major. Yet the META-INF exists and the class is good in the package "CEO". Here is my MANIFEST.MF file
    Code:
    Manifest-Version: 1.0
    Main-Class: CEO.Principale
    Can any one please help me with this? Thanks in advance.

  2. #2
    Join Date
    Dec 2009
    Posts
    211

    Re: How to create manifest.mf and jar files in java

    So what exactly is the problem? Apparently, your jar is properly created, it has the manifest file in (the good one?, That is to say that you have created, not "empty"?), But when you launch the program, outside Eclipse via your jar, it crashes? And your classpath is OK?
    For more help
    1) How to create an executable jar?
    2) What is JAR file? Please explain
    3) Creation of jar file with MS-DOS
    4) Define Manifest File in Java
    5) Define Manifest File in Java
    6) How to run a jar file

  3. #3
    Join Date
    Jan 2010
    Posts
    126

    Re: How to create manifest.mf and jar files in java

    It is precisely when I run it outside of eclipse that AC plant.
    And your classpath is OK?
    Where should I configure it? My application works fine in eclipse but when I create a jar, and I want to run the application outside of Eclipse using the jar, it is at this moment that I get an error message error.

  4. #4
    Join Date
    Nov 2009
    Posts
    359

    Re: How to create manifest.mf and jar files in java

    I used the same as you, the Manifest file but I have no problem. In my opinion this comes from a call when executing. How do you executed your jar? Do you use external jar? For example if you need packages contained in an archive test.jar which is the same as the jar that you created, should be indicated in the manifest and in the CLASSPATH when executing. Then for the execution you do if you executes the command in the directory of your jar if not in place of "." you should put "MYPATH" or MYPATH is the path of your application.
    Code:
    java-classpath "." -jar test.jar

  5. #5
    Join Date
    Sep 2009
    Posts
    131

    Re: How to create manifest.mf and jar files in java

    How to configure Eclipse so that it includes the archives used because I do not swing but swt? I added them in my perspective but eclipse does not include them when creating the jar. There is surely a configuration to do but I do not know which. If anyone has the solution, it is welcome.

  6. #6
    Join Date
    Dec 2009
    Posts
    263

    Re: How to create manifest.mf and jar files in java

    In fact, Eclipse is doing all alone with the classpath, through its own system files (. Classpath in each project). So, until we have tried outside of Eclipse, we do not see the difficulty.

  7. #7
    Join Date
    Nov 2009
    Posts
    330

    Re: How to create manifest.mf and jar files in java

    Absolutely, nothing like making a small jar to himself in the hand at least we are sure that it works, and we know what is wrong when it does not. It's as if you were forced to open VB to launch your application as being unable to make one. Exe

Similar Threads

  1. Replies: 3
    Last Post: 09-12-2011, 02:40 AM
  2. How to create a rolling log files in java?
    By Cordaro in forum Software Development
    Replies: 4
    Last Post: 06-02-2010, 08:39 PM
  3. Define Manifest File in Java
    By Sandy22 in forum Software Development
    Replies: 3
    Last Post: 09-11-2009, 06:34 PM
  4. Manifest files deleting problem
    By Benito in forum Networking & Security
    Replies: 2
    Last Post: 13-06-2009, 02:56 PM
  5. How to create a manifest for my DLL
    By GunFighter in forum Software Development
    Replies: 3
    Last Post: 02-04-2009, 12:55 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,140,445.79556 seconds with 17 queries