Setup Jetty 7 with JSP engine
I've been trying to get Jetty to run my web app via a custom la开发者_StackOverflow中文版uncher (embedded). I am trying to figure out how to tell Jetty which java compiler to use for JSPs. I want to do what java -jar start.jar -OPTIONS=jsp
does, but without using start.jar.
Here is what shows on the console:
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
Do I need to put the javac libraries into my classpath?
You need to have a JAVA_HOME
environment variable pointing to the root folder of the JDK. Here's an extract of the Sun guide on the subject:
2) To set
JAVA_HOME
:
- Right click My Computer and select Properties.
- On the Advanced tab, select Environment Variables, and then edit
JAVA_HOME
to point to where the JDK software is located, for example,C:\Program Files\Java\jdk1.6.0_02
.
Most servletcontainers like Tomcat doesn't need it because they ships with its own compiler.
精彩评论