aspose file tools*
The moose likes Tomcat and the fly likes Tomcat: No Java compiler was found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat: No Java compiler was found" Watch "Tomcat: No Java compiler was found" New topic
Author

Tomcat: No Java compiler was found

blackcarlos Dibia
Greenhorn

Joined: Mar 30, 2005
Posts: 21
pls ranchers I,m new to jsp technology and having problems deploying this page
here is the code I'm using J2EE 1.4
<%--Import the Java packages --&>
<% @ page language="java"%>
<% @ page import="java.lang.*"%>
<html>
<font size=4 face="Verdana" color=#112244>
<body>
<%
String str =request.getParameter("r1");
String str1 =request.getParameter("t1");
String str2 =request.getParameter("t2");
String final_output="";
int num1=0;
int num2=0;
int num3=0;
num1 = Integer.parseInt(str1);
num2 = Integer.parseInt(str2);
if(str.equals("add")
{
num3=num1+num2;
final_output="Addition";
}
if(str.equals("sub")
{
num3=num1-num2;
final_output="Subtraction";
}
if(str.equals("div"))
{
num3=num1/num2;
final_output="Division";
}
if(str.equals("mul"))
{
num3=num1*num2;
final_output="Multiplication";
}
%>
<%-- Displaying the option selected --%>
The selected mathematical function by you is : <%=final_output%>
<br>
<%
Integer in=new Integer(num3);
out.println("The Result is " + in.toString());
%>
</body>
</html>
and here is the html file to access it
<html>
<body>
<h2>Mathematical Functions</h2>
<font size=4 face="Verdana" color=#112244>
<form method="post" action="Calculate.jsp">
<input type="radio" name="r1" value="add" checked="false">Addition
<br>
<input type="radio" name="r1" value="sub" checked="false">Subtraction
<br>
<input type="radio" name="r1" value="mul" checked="false">Multiplication
<br>
<br>
Enter two numbers:
<input type="text" name="t1" value="">
<input type="text" name="t2" value="">
<br>
<br>
<input type="Submit" name="b1">
</form>
</body>
</head>
</html>
after deployment I get this error from the server
org.apache.jasper.JasperException: Unable to compile class for JSP

No Java compiler was found to compile the generated source for the JSP.
This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK
to the common/lib directory of the Tomcat server, followed by a Tomcat restart.
If using an alternate Java compiler, please check its installation and access path.
pls how can I sort it out
[ July 19, 2005: Message edited by: Bear Bibeault ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61430
    
  67

Moved to the Tomcat forum with appropriate subject change.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
blackcarlos Dibia
Greenhorn

Joined: Mar 30, 2005
Posts: 21
Pls I am kind of confused, I'm using J2EE 1.4 and not a tomcat server!
I have been using the deploytool and it works fine for servlets but I got this error when trying to deploy this jsp pls I would love to get a more relevant response
pls I need the help to move on since I'm new to jsp technology
would greatly appreciate it
blackcarlos
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42283
    
  64
I think Tomcat is the reference server that comes with J2EE, so you might actually be using it. Try to find the directories mentioned, and see if the file in question is where the message says it should be.


Ping & DNS - my free Android networking tools app
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

If you're new to JSP, you might have an easier time if you just download and install an instance of Tomcat.
Most of the books and tutorials I've seen use it to run their examples.

With Tomcat, you don't need j2ee. It ships with the components it needs.
Just having a j2se is sufficient.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
jQuery in Action, 2nd edition
 
subject: Tomcat: No Java compiler was found