2

Kinda new posting up questions here so bear with me. I had to install a XP VM recently in order to run a program that required use of an Oracle 10g client. I setup my tomcat server and when I went through the directory and started the .jsp file, I got this error

2011-02-22 09:13:01,291 ERROR (org.apache.jasper.compiler.Compiler:394) - Javac exception 
Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK

Weird thing is I set my JAVA_HOME variable in my VM to 'C:\Program Files\Java\jdk1.6.0_24;' and my PATH variable to '%JAVA_HOME%\bin;'.

It says that its a jasper-complier error... I made sure to add several TOMCAT_HOME variables in my eclipse library path that looked at the jasper-compiler,jasper-runtime,jsp-api.jar, and servlet-api.jar located in my tomcat server folder.

I also followed these instructions here, that state to add the jdk\bin's tools.jar to Eclipse's Ant runtime global entries

Any help appreciated, I'm stumped.

skaffman
  • 398,947
  • 96
  • 818
  • 769
B.Z.B
  • 471
  • 2
  • 10
  • 24

3 Answers3

1

It usually happens because Oracle ships with an outdated version of JDK which conflicts the PATH that we set. Scan your PATH environment variable for any oracle JDK and remove it. It should help.

adarshr
  • 61,315
  • 23
  • 138
  • 167
1

Look into your Launcher configurations (of type 'Apache Tomcat') and find the one created when you launched the JSP. There must be an 'environment tab'. You could define the JAVA_HOME here. Is this a version 5 of Tomcat (or earlier) ? Starting with version 5.5, Jasper has an embedded JDT (eclipse java compiler).

Alain Pannetier
  • 9,315
  • 3
  • 41
  • 46
1

Hey I figured it out, just made sure you add to your JDK to your PATH variable (ie. java\jdk...\bin) and I also added it to my tomcat\lib folder and added it to my projects library as another variable.

B.Z.B
  • 471
  • 2
  • 10
  • 24