File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes application entry point Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "application entry point" Watch "application entry point" New topic

application entry point

chen young
Ranch Hand

Joined: Sep 09, 2005
Posts: 197

I have a problem to set correct the main entry point in my application

This is the structure that I want to create in the jar:

bin (contain all the classes & the main class -> bin/gui/Main )
properties(properties and xml files)
images(contain all images)
lib(contain all jars)

I run this command in order to create the jar(and its working ok): jar cfvm rcy.jar manifest.txt bin lib properties images

I try few combinations in the manifest file but unfortunately it�s still don�t recognize the main class.

Any suggestions?

Henry Wong

Joined: Sep 28, 2004
Posts: 20514

Jar files don't exactly work that way... First, you can't just place class files anywhere. They have to be placed based on package. Second, you can't just place the manifest in the root. They should be placed in the directory reserved for manifests. And third, I don't think that you are allowed to place jar files in jar files.

Once placed correctly, you can specify the main by a field in the manifest. You can also specify the classpath to use, to locate the other jars, by another field in the manifest.


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
I agree. Here's the link:
subject: application entry point
It's not a secret anymore!