Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

error in running server- problem with jar file

 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
D:\Developer\scjd\starting>jar cmf lib\server.mf build\server.jar build\server\*
D:\Developer\scjd\starting>java -jar server.jar
Failed to load Main-Class manifest attribute from
server.jar
Iam getting this error.
my server.mf contains
Main-Class: suncertify.server.RemoteServerManager
The default manifest file copies this content. still i have problem in running server.
pls respond asap.
Thanks
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the .bat file that I had for making the jar files


In yours I didn't see where you included the manifest file.
Hope that helps
Mark
 
Reshma Das
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
D:\Developer\scjd\starting>jar -cvfm build\server.jar d:\developer\scjd\starting\lib\server.mf d:\de
added manifest

I did the same still iam getting error.
D:\Developer\scjd\starting>java -jar server.jar
Failed to load Main-Class manifest attribute from
server.jar
Is there any other way to do it.
My manifest.mf contains:
Manifest-Version: 1.0
Main-Class: suncertify.server.Server
Created-By: 1.3.1_01 (Sun Microsystems Inc.)
 
Mark Spritzler
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well the manifest file looks correct. But what directory do you have it stored in? and when you add it to the jar, does it put pathing in it?
You cn use a tool like Winzip to see that information.
The manifest file needs to not have any path in that jar file, meaning it is the root. Therefore the other classes have the path. In the manifest file the main class is "suncertify.server.Server"
Therefore it will look at/for a path of suncertify/server for a class called Server in the jar file.

Mark
 
But how did the elephant get like that? What did you do? I think all we can do now is read this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic