Skip to main content

Could Not Find The Main class .Program will exit

8 replies [Last post]
rajisp
Offline
Joined: 2008-01-23

Hi,
I am trying to create a jar file Contains some of the Java3D classes.
i used the command jar cfm [jarfile] [manifestfile] [class]
to create the jar file.
When I double clicked to open the jar file I am getting a Java Virtual Machine Launcher containing "Could Not Find The Main class .Program will exit" error.

What should i do to solve this?
when i used java -jar jarfile in command window i got an exception like

Exception in thread "main" java.lang.NoClassDefFoundError: javax/media/j3d/Node

Thanks

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
rajisp
Offline
Joined: 2008-01-23

I solved that problem by copying some of the jar files that need for the application to run in to my folder...
now i can run that application..
Thanks..

dephny
Offline
Joined: 2008-04-19

I am having exactly the same problem.Can you please explain what can I do to overcome this difficulty.When I click on my jar file it says could not find the main class.the manifest file is there.Everytihng must be OK.I cannot solve the problem.Hope you will help me.:)

rajisp
Offline
Joined: 2008-01-23

My problem was regarding the java3d jar files.i add that to the manifest in Class-Path attribute..But even now I can't run my application while double clicking on it. am using the command [b] java -jar JarFile.jar[/b] to execute that.I dont know what the issue is,may be because of my class path.

Dmitri Darine

It is slightly off-topic :)

For a jar file to be executable it must have MANIFEST.FM file inside
containing the following:

Manifest-Version: 1.0
Main-Class: your.package.YourMainClass

Create your jar file using Eclipse or NetBeans - they will do the work
for you.

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@java3d.dev.java.net
For additional commands, e-mail: interest-help@java3d.dev.java.net

rajisp
Offline
Joined: 2008-01-23

you mean MANIFEST.MF..?
yes... I tried it out in Eclipse also..But there also the same problem while opening the jar file..

I tried to create jar file for another Java3D file...there also the same but the jar file for a simple java file is working efficiently..So I thing if there any other issues regarding Java3d files..

Dmitri Darine

you have to describe your goal clearly.

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@java3d.dev.java.net
For additional commands, e-mail: interest-help@java3d.dev.java.net

danier
Offline
Joined: 2006-12-12

use Ant (Apache Ant).

rajisp
Offline
Joined: 2008-01-23

Thanks for the reply..
How can I use Ant?
Sorry am just new to Java3D..
I think there is no need for using Ant in that,....am not sure..
Is there any other solutions?
I am using Eclipse as IDE
Thanks