aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes to understand which *.MF to use Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "to understand which *.MF to use" Watch "to understand which *.MF to use" New topic
Author

to understand which *.MF to use

Steve Howerton
Ranch Hand

Joined: Oct 18, 2011
Posts: 41
I am learning to build.xml a project with eclipse ide.
below is the MANIFEST.MF that I am creating.
The build shows that the manifest is being written in the dir structure below.
The dir META-INF (sibling to the src) contains this MANIFEST.MF









the following MANIFEST.MF is in the jar file too.
it is in the bin dir of the jar file.




I am attempting to run the dist.jar.
below is the error. Why does my project never find the Main of my app?
Thanks.




a look inside my dist.jar note that the dir "build.classes.model.Main" is the Main I would like to have found.

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5827
    
    7

The contents of your JAR file are incorrect - it looks like you included every file in your project! Instead, you want to include only the files in build/classes, or perhaps only the files in bin. That is why it cannot find your main class.

The fact that you have duplicate files in multiple locations means you have let your directory structure get out of control. My recommendation is to study Maven, at least just enough to understand the directory structure that Maven forces on you, and then adopt that same structure.

Also, if you post your build.xml, we might be able to help you clean it up.


JBoss In Action
Steve Howerton
Ranch Hand

Joined: Oct 18, 2011
Posts: 41
Thanks
I will have to study the link you supplied and try to understand a better structure for the build and how to jar it up properly.
I am using a temporary computer to I will return soon and supply the work I have done concerning the build.xml Thanks again.
Steve Howerton
Ranch Hand

Joined: Oct 18, 2011
Posts: 41
I have not studied the Maven link provided yet.

I have the build.xml. I have two other *.xml that I am using to test and output various new things
I am learning while trying not to corrupt the build.xml. I will add a properties sheet too. The build is doing most of the dir work. I am still studing the link provided however any feed back on my build.xml would be great.















Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5827
    
    7

The problem is at line 66 of the build.xml:



The basedir property here is for the root directory where the class files are located, bot the base directory of the project! The ${basedir} property is the project root, you probably want to use ${classes.dir.location} instead.
Steve Howerton
Ranch Hand

Joined: Oct 18, 2011
Posts: 41
Thanks I will look into that
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: to understand which *.MF to use