• 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

Problems creating a jar

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

Am running Windows XP SP3

Have tried to create an executable jar file to run my database file against. The code works fine in Eclipse 3.4.1.

Manifest.mf contents
=============
Manifest-Version: 1.0
Main-Class: suncertify.client.ContractorApplicationStartup

Jar Creation
========
jar -cfvm code.jar Manifest.mf -C bin .

This seems to work fine and creates the jar file and shows all the classes and manifest in the output.

Jar Execution
=========

javaw -jar code.jar alone

This just gives me a beep and does nothing.

Is there anyway I can debug the jar to see the problem or can anyone spot a glaring error that I cannot see.

Thanks Kevin.


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

javaw -jar code.jar alone

you should use

java -jar...
 
Kevin Florish
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Alec

I was using the example from Monkhouse book, should have checked the errata

Now I get a "Failed to Main-Class manifest attribute from code.jar" error when running

java -jar code.jar alone

Manifest File is called Manifest.mf and contains:



This along with my bin directory were in my SCJD base directory and I created the jar from the SCJD directory as follows:



All the files were displayed ok including the following 2 entries:




Ah I needed to add a blank line to the end of the manifest file :O

Thanks Kevin.



 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic