Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Other Java > BOOK: Beginning Cryptography with Java
|
BOOK: Beginning Cryptography with Java
This is the forum to discuss the Wrox book Beginning Cryptography with Java by David Hook; ISBN: 9780764596339
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Cryptography with Java section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 28th, 2006, 07:34 PM
Registered User
 
Join Date: May 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default my .jar doesn´t "call" Javamail library

Hi. I have an application that sends messages using Javamail. It works fine with the IDE but when I want to run the .jar from command line I get

Exception in thread "main" java.lang.NoClassDefFoundError: javax/mail/MessagingException
        at inicio.Main.main(Main.java:24)

I have copied mail.jar and activation.jar in jre/lib/ext and /lib.

1. How can I specify the classpath using the the -jar option (Since I want to run a jar, not a class)?
2. How would I modify the manifest to "tell" the jar where to look?

I am using NetBeans 4.0 with JDK 1.5.0_06.

Thanks in advance.

 
Old May 28th, 2006, 08:03 PM
dgh dgh is offline
Wrox Author
 
Join Date: Aug 2005
Posts: 206
Thanks: 0
Thanked 20 Times in 20 Posts
Default

You can find details on 1 and 2 in the documentation for the java tool and the documentation on jar files that comes with the JDK.

With the missing class, the most common reason for this, if you're using windows, is that the command line uses the JRE install not the JDK install. If you are using windows you should check that lib/ext of the JRE install also contains the jar file.

The other reason this can happen is if the jar has somehow being included twice in the classpath.

Regards,

David






Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript library to call a web service? markguy Javascript How-To 0 May 24th, 2007 05:52 PM
Call or linking to external .jar file tony_s Java Basics 0 December 16th, 2006 05:20 PM
RountingSlip doesn´t work Ravel99 Pro VB 6 0 April 26th, 2006 08:33 AM
Need ldapfilt.jar and ldapjdk.jar minhpx J2EE 0 June 14th, 2005 10:27 PM
Session_OnEnd doesn´t work Adlorenzo ASP.NET 1.0 and 1.1 Professional 7 May 22nd, 2004 04:32 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.