Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to compile class exception

 
Mike Han
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
I am using tomcat 3.2 on local machine,in one of my jsp page I have directive <%@ page import = "java.util.ArrayList" %> when this page is accessed in the program, tomcat gave the message :
Unable to compile class for JSPD:\tomcat\work\localhost_8080%2Fconference\_0002fsrc_0002flbm_0002fPaperManJSP_0002ejspPaperManJSP_jsp_0.java:15: Class java.util.ArrayList not found in import.
import java.util.ArrayList;
^

Can anybody give me any help on that?
Thanks in advance.
Mike
 
Dave Soto
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like maybe your JAVAHOME is not correctly set. It needs to be pointed to your JDK. Are you able to run other servlets/apps on this same machine, or is this your first one, because it sure sounds like your servlet engine can't see your JDK.
 
Mike Han
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Dave
Thank you for response.
The other jsps and servlets work well.Even for this JSP page,once I changed the
import="java.util.ArrayList"
to
import="java.util.*"
compiling can go through this statement but failed at the Arraylist variable I define in the page.
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ArrayList is available in java 2 and up. You must be using jdk 1.1.something. and not jdk 1.2 or higher. You can either download JDK 1.2.2 or higher or just use a Vector instead of ArrayList.

Bosun
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic