Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Failed to load Main-class manifest attribute

 
Sangitha Padmanaban
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
i'm facing a problem while including a jar file in my class path.When i try to do the same an error is prompted telling "Failed to load Main-class manifest attribute from *.jar".Hence i'm getting errors on compiling a file that need these class files in the Jar.But on echoing the classpath i do see that these jar files are present in the classpath..Really confused.Can anyone help me out??
 
Chris Hurst
Ranch Hand
Posts: 443
3
C++ Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As no one else is answering this ;-)

I really would need to see the command you are executing and the jar , class path , as its a little confusing as to what you intended and therefore as to what has gone wrong... but did you actually want to define a main class in the jar.

It almost sounds like you are using java with the -jar option when you didn't want to use a jar in this way i.e. you just wanted the jar to be on the classpath i.e using -cp -classpath.

The error means you have told java that you wish to execute one jar file (with possibly others on the classpath) when you execute java in this way it opens the manifest looks for the line that defines the main class and then attempts to load it from the jar in your case its failing to find it. Your not trying to execute one jar but have the main class specified in another jar ??

You mention compiling which is the javac command I wasn't aware that could give the error mentioned ... any one ??
 
Sangitha Padmanaban
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi chris,

I worked on it and got it resolved.The problem was in the class file in class file that was in the included jar file.Thnk you
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic