Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2006

Tip: Looking for answers? Try searching our database.

classpath woes

Thread view: 
Mark Probert - 13 Jul 2006 19:47 GMT
Hi, all.

I am new to Java, though experienced in other languages, and I am not
really getting the CLASSPATH thing.  Here is my exact problem:

I am trying to use an SNMP library (from Westhawk).  The library tests
run fine and the example code works okay (executed via Ant).  Now, I take
the library jar and try and make it work from the command-line.  Javac is
not a problem and I get my class files, then create an app jar (called
disp1.jar).  My problem comes when I try and run it:

(mark@locke) 11:42 $ java -cp snmp5_1.jar -jar disp1.jar
Exception in thread "main" java.lang.NoClassDefFoundError:
uk/co/westhawk/snmp/stack/AsnOctetsPrintableFace
    at java.lang.ClassLoader.defineClass0(Native Method)
    <etc.>

Now, that missing class is in the snmp5_1.jar.  I can unjar it and see it
in there.

So, what gives?  Obviously I am not understanding something here.

Regards,

Signature

-mark.  (probertm @ acm dot org)

Danno - 14 Jul 2006 01:06 GMT
> Hi, all.
>
[quoted text clipped - 22 lines]
> --
> -mark.  (probertm @ acm dot org)

In the manifest file you need an entry called Class-Path: in addition
to Main-Class:

for more info go here:
http://java.sun.com/docs/books/tutorial/deployment/jar/downman.html

By the way once you have that you can just run:
java  -jar disp1.jar

Good Luck and let us know
Mark Probert - 14 Jul 2006 17:56 GMT
> In the manifest file you need an entry called Class-Path: in addition
> to Main-Class:

Many thanks, Danno.  Just perfect!

Regards,

Signature

-mark.  (probertm @ acm dot org)



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.