Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

new to jsp----a small problem about jsp compile

 
huanyu zhao
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone. I'm new to using JSP and just picked up the book "Beginning JSP 2-From Novice to Professional" the other day. I'm trying to run the first jsp examples, but I keep getting an exception error:





I checked to make sure that my JAVA_HOME environment variable is pointing to my SDK directory, it is. And Tomcat is already installed, and I can view the main page, by going to localhost:8080.
I'm not sure what else to check. So, if some kind frined could point me in the right direction, I'd greatly appreciate it.






 
Sheldon Fernandes
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try these system variable values:

JAVA_HOME=C:\jdk
PATH=%JAVA_HOME%\bin;%CATALINA_HOME%\bin...

Sheldon Fernandes
 
huanyu zhao
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sheldon Fernandes:
Try these system variable values:

JAVA_HOME=C:\jdk
PATH=%JAVA_HOME%\bin;%CATALINA_HOME%\bin...

Sheldon Fernandes


the same error...still

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
 
huanyu zhao
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my enviroment is
win2003 std sever
JavaTM 2 SDK, Standard Edition Version 1.4.2
Tomcat5
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65118
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since this is in all probability a Tomcat setup issue, I'm moving this on to the Tomcat forum.
 
Sheldon Fernandes
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It doesn't look like C:\jdk is the JAVA_HOME for your JDK 1.4.2 installation.

The folder will be named something like "jdk1.4.2" and would contain the following folders
- bin
- include
- jre
- lib
Change JAVA_HOME to the right jdk 1.4.2 installation.
CATALINA_HOME should point to the directory in which Tomcat 5 has been installed.

The lib folder contains tools.jar which has your javac utility.
Sheldon Fernandes
[ October 01, 2004: Message edited by: Sheldon Fernandes ]
 
Sheldon Fernandes
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you do not have a JDK installed, you could still work with a JRE. But you would need tools.jar to be placed somewhere in your server classpath.

For more information on how to setup Tomcat click here.

The below is an extract relevant to your problem.
Java location: The installer will use the registry or the JAVA_HOME environment variable to determine the base path of the JDK or a JRE. If only a JRE (or an incorrect path) is specified, Tomcat will run but will be unable to compile JSP pages at runtime. Either all webapps will need to be precompiled (this can be easily done using the Tomcat deployer), or the lib\tools.jar file from a JDK installation must be copied to the common\lib path of the Tomcat installation.


Sheldon Fernandes
 
huanyu zhao
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the lib\tools.jar file from a JDK installation must be copied to the common\lib path of the Tomcat installation.


this sentece makes my example worked!
thankx
 
Jean Gravier
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Had the same problem with win2k server, same solution worked
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic