wood burning stoves 2.0*
The moose likes Servlets and the fly likes tomcat- set JAVA_HOME point to jdk.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "tomcat- set JAVA_HOME point to jdk.." Watch "tomcat- set JAVA_HOME point to jdk.." New topic
Author

tomcat- set JAVA_HOME point to jdk..

jayasri raghu
Greenhorn

Joined: Jan 20, 2001
Posts: 8
Hi,
I followed Ajan Balakrishnan's instructions to download and install tomcat.However when I start the server by double clicking the startup.bat, it says
" you must set JAVA_HOME to point at your java development kit
installation"
My jdk is in c:\jdk1.3 and
jakarta-tomcat-3.2.1 is in c:\jakarta-tomcat-3.2.1
My autoexe.bat is as follows
set JAVA_HOME =c:\jdk1.3
set TOMCAT_HOME=c:\jakarta-tomcat-3.2.1
PATH=C:\BC5\BIN;%PATH%;C:\ORAWIN95\BIN;c:\jdk1.3\bin;c:\jakarta-tomcat-3.2.1\bin;
set CLASSPATH=%CLASSPATH%;c:\\lib;c:\\lib\tools.jar;c:\jakarta-tomcat-3.2.1\lib\servlet.jar;
Can anybody point out the mistake?
Thanks in advance
jayasri raghu
Ajan Balakrishnan
Ranch Hand

Joined: Jan 04, 2001
Posts: 71
Did you try after rebooting the machine. I assume you are using window 98/95 machine. WIn98/95 requires reboot the machine to have the env. variables take into effect.
One quick question to everybody guys. Did anybody tried Tomcat with jdk1.3 . I heard guys having problems with it. Please confirm

Ajan

[This message has been edited by Ajan Balakrishnan (edited February 05, 2001).]
Jan Volkmann
Greenhorn

Joined: Feb 01, 2001
Posts: 17
Originally posted by Ajan Balakrishnan:

One Question guys. Did anybody tried Tomcat with jdk1.3 . I heard guys complaining about problems. Please confirm


There are ALWAYS problems but I dunno if it's down to tomcat vs. jdk1.3 The biggest trouble is to identify the problem itself, I think (is it tomcat, jdk, os, servlet-code, paths,...?). There's no tools.jar in jdk1.3, so you don't have to bother about that. I'm not sure about WAR-files and how to use them. But tomcat seems to work just fine with jdk1.3. So, if you're thinking about an upgrade to 1.3 the tomcat stuff shouldn't stop you from doing so.
The only problem is that no one knows about it so it's not easy to get some good advice. Anyway, I just started dealing with servlets. I'm not an expert, really. So, feel free to correct me.
jayasri raghu
Greenhorn

Joined: Jan 20, 2001
Posts: 8
Hi Ajan,
I did reboot after changing the environment variables.Is there any mistake in
"set JAVA_HOME = c:\jdk1.3"?
with regards
jayasri raghu
Ajan Balakrishnan
Ranch Hand

Joined: Jan 04, 2001
Posts: 71
I see a space before the '=' sign in your JAVA_HOME setting.I don't know if this may cause any problem .I don't see any other problem here. My setup is exactly like yours except i'm using jdk1.2.2
Try changing your setting from
set JAVA_HOME =c:\jdk1.3
TO
SET JAVA_HOME=c:\jdk1.3
and reboot
Ajan
jayasri raghu
Greenhorn

Joined: Jan 20, 2001
Posts: 8
Thanks Ajan. u r correct.Now the server starts.
I copied the Helloworld.class file into
c:\jakarta-tomcat-3.2.1\webApps\ROOT\WEB-INF\classes
I typed the
url in ie,
http://localhost:8080/servlet/HelloWorld
an error message is displayed
"the requested url is not avaliable offline
http://localhost:8080/servlet/HelloWorld "
(I encountered the same problem with java web server also)
Please help me.
with regards
jayasri
Ajan Balakrishnan
Ranch Hand

Joined: Jan 04, 2001
Posts: 71
Jayasri,
Try with URL http://127.0.0.1:8080/servlet/HelloWorld
or http://YourMachineName:8080/servlet/HelloWorld
instead of
http://localhost:8080/servlet/HelloWorld
Ajan
jayasri raghu
Greenhorn

Joined: Jan 20, 2001
Posts: 8
Ajan,
Thanks.I tried both. Alas! I didn't work.Do you think that
a) I need to change any of the browser(IE) settings?
b) reinstall the browser?
warm regards,
jayasri.
davidlong
Greenhorn

Joined: Jan 28, 2001
Posts: 21
hi
if u click fresh icon, then I believe IE will pop up a small window to ask u if u want connect online. if u yes, then IE would work out the URL actually is on local machine and connect it for u.
There is nothing wrong with u URL but just IE is stupid in this way of working. Every time u need connect first before it works for u.
David
jayasri raghu
Greenhorn

Joined: Jan 20, 2001
Posts: 8
Hi David,
Thank u very much.It works!!!Imagine such a simple step holding me and driving me crazy for a month!
Hi Ajan,
Thank you very much for guiding through the entire process.
Hi folks,
got one more doubt.When I invoke a servlet from a html,
a)where do i put the html file?
b)what is the url for invoking the html file.
with lot of thanks
jayasri.
Ajan Balakrishnan
Ranch Hand

Joined: Jan 04, 2001
Posts: 71
Hi Jayasri,
I know this message is answered a little late. SOrry for that. But in case if you haven't figure out already keep your html file in
jakarta-tomcat-3.2.1\webapps\Root\yourfile.html directory and use URL http://localhost:8080/yourfile.html
Ajan
jayasri raghu
Greenhorn

Joined: Jan 20, 2001
Posts: 8
Hi Ajan,
Thank you for your response.
My param.html is c;\jakarta-tomcat-3.2.1\webapps\Root\param.html
which invokes ParamServlet as
<form action=http://localhost:8080/servlet/paramServlet method=get> and the servlet is in
c;\jakarta-tomcat-3.2.1\webapps\Root\WebInf\class\paramServlet
when i invoke the url http://localhost:8080/param.html,
the html page is displayed.when i submit it,the servlet is not
invoked.Instead the FileDownload icon appears asking
whether you want to open the file from its place or
save it to disk.
can you help me?
with regards
jayasri raghu
Ajan Balakrishnan
Ranch Hand

Joined: Jan 04, 2001
Posts: 71
Hi Jayasri,
The first thing i do if i get this message is check the servlet code to see if it output any content(mime type) which IE(i assume ) cannot resolve. The default is text/html. If it is anything other than html explicitly set the content type. For example if output is xml set the content type to text/xml
(res.setContetType("text/xml");

Anyway try this sample. Here the servlet outputs html
HTML

SERVLET


Let me know if this helps

Ajan
jayasri raghu
Greenhorn

Joined: Jan 20, 2001
Posts: 8
Hi Ajan,
You got it right.I've made a silly mistake while setting the
content type.Being the first time,I got confused. I am able to run mine and your files.Thank you.One more question please.Does tomcat support ssI(.shtml) and servlet chaining?
Thank you very much.
with regards
jayasri raghu
Ajan Balakrishnan
Ranch Hand

Joined: Jan 04, 2001
Posts: 71
I'm not sure if tomcat support SSI. But my understanding is any servlet engine conforming to Servlet API 2.0 specification may use ApacheJSSI for the SSI support.I never got a chance to evaluate this myself but worth trying . For more details see http://java.apache.org/
Ajan
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: tomcat- set JAVA_HOME point to jdk..
 
Similar Threads
The CATALINA_HOME enviornment variable
Tomcat Error: JAVA_HOME must point...
new to servlets! plz help!!!
Tomcat Installation
tomcat error