• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

I cant run any jar files

 
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey everyone,

I cannot run any jar files.

I downloaded Derby today to play around with databases

I get this error all the time:
"Failed to load Main-Class manifest attribute from
C:\Derby_10\lib\derby.jar"

why is this?

Oh and any other Jars I download is the exact same

davy
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Davy,

Not every jar file is runnable.
Let's suppose that you create a set of utility classes that you would like to assemble and distribute as a jar file.

It is very probable that none of the classes contained in your jar file has a main method. Maybe it wouldn't even make any sense to have any main method in your classes.

Just to begin with, you cannot directly "run" a jar file if there is no main method to be called in any of its classes. Even if a main method exists, if you would like to run it this way:

java -jar myjarfile.jar

you would need to include a Main-Class entry in the jar's manifest file.

In the case of Derby, you should read its documentation, which explains how you are supposed to use it.
 
The two armies met. But instead of battle, they decided to eat some pie and contemplate this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic