Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

need some help

 
sandya patel
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 313
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic