File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes need some help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "need some help" Watch "need some help" New topic

need some help

sandya patel

Joined: Apr 23, 2005
Posts: 21
Hi all
I am trying to execute the Prim Numbers example given in i am getting errors when compiling file. the errors I got are

javac Undefined variable or class name: Primes
BigInteger start = Primes.random(numDigits);
^ Undefined variable or class name: Primes
start = Primes.nextPrime(start);
2 errors

kindly someone get back to me and tell me where i went wrong.

Byron Estes
Ranch Hand

Joined: Feb 21, 2002
Posts: 313
My guess is that Prime is another class that they wrote which is not available in your classpath. You should compile them all at once rather than one at a time.

javac *.java

Just make sure all the java files for every class you need to compile that is referenced is in the default directory.

Hope this helps...


Byron Estes<br />Sun Certified Enterprise Architect<br />Senior Consulant<br />Blackwell Consulting Services<br />Chicago, IL<br /><a href="" target="_blank" rel="nofollow"></a>
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Each chapter in that book builds on previous chapters.
Look back in the book for the first chapter that builds an app that displays prime numbers.

Build that class and make sure it's on your classpath.

BTW: One of the things that I love about that book is that he teaches the aspects of Servlet/JSP programming in just the right order. It's worth the time to go through the whole thing in order.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: need some help
It's not a secret anymore!