Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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
Author

need some help

sandya patel
Greenhorn

Joined: Apr 23, 2005
Posts: 21
Hi all
I am trying to execute the Prim Numbers example given in http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/. i am getting errors when compiling PrimeList.java file. the errors I got are

javac PrimeList.java
PrimeList.java:45: Undefined variable or class name: Primes
BigInteger start = Primes.random(numDigits);
^
PrimeList.java:47: 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.

Sandya
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...

Goodluck!


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

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
 
GeeCON Prague 2014
 
subject: need some help