Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in JSP --help please

 
kaarthik asokkumar
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use Tomcat 5.0.
I created a servlet which will pass the result to a JSP page. I got an error saying that

**Unable to compile class for JSP
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.

but ive set the environment variable JAVA_HOME to javac. should i have to set java home in apache?? if yes where should i set in apache. THanks for ur help
 
sangeeta kapoor
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java_home needs to be set to ur jdk
Eg

c:\jdk
 
kaarthik asokkumar
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks sangeetha but ive already set my java_home to my jdk its still not working

public void doPost(HttpServletRequest request,HttpServletResponse response) throws IOException,ServletException
{
String c=request.getParameter("color");

CoffeeExpert ce=new CoffeeExpert();
List result=ce.getbrands(c);

request.setAttribute("styles",result);

//1 **RequestDispatcherview=request.getRequestDispatcher("result.jsp");
view.forward(request,response);
}

Exception is thrown in line 1
 
kaarthik asokkumar
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for every one i finally fixed the probs. I had to reinstall the tomcat and then set the java home then to my jdk during my installation and worked
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!