I'm trying to run a Jetty web framework from main(...)
that loads a spring web context which loads JSPs at runtime. This works great from the command line using mvn exec:java
on OSX and Linux. However on Windows, running Cygwin, I cannot get it to fully work.
The application loads and the web-context seems to build fine. However when the first JSP page is rendered the JVM goes to compile it on the fly and throws the following error/exception:
org.apache.tools.ant.BuildException: 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
at org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(CompilerAdapterFactory.java:105) ~[gwt-dev-2.5.1.jar:na]
at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:924) ~[gwt-dev-2.5.1.jar:na]
at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:757) ~[gwt-dev-2.5.1.jar:na]
at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:382) [gwt-dev-2.5.1.jar:na]
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:472) [gwt-dev-2.5.1.jar:na]
...
I've done a ton of web searches and tried a number of things before posting.
- The
JAVA_HOME
variable is set correctly. - I've made sure that it is pointing at the JDK and not the JRE. The
tools.jar
file does exist under%JAVA_HOME%/lib/tools.jar
. - The
JAVA_HOME
path is inProgram Files
and I was worried about the space but replacing it withProgra~1
does not seem to work either. - We've tried both the
mvn
shell script under Cygwin as well as themvn.bat
script under DOS but both fail similarly.
Anyone else had this problem? Do I need to change the classpath
to specifically add a dependency to the tools.jar
somehow? Maybe something added to the pom.xml
? Thanks in advance.