File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Linux / UNIX and the fly likes jdk, linux, tomcat and all please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "jdk, linux, tomcat and all please help" Watch "jdk, linux, tomcat and all please help" New topic
Author

jdk, linux, tomcat and all please help

Gloria Hans
Greenhorn

Joined: Nov 06, 2003
Posts: 18
I have to publish a database to the intranet of a company. For that, I am planning on using servlets and jsp.
On the laptop I was using before everything was installed alreadyat school). So now i have to install everything and I am confused. I downloaded tomcat from the jakarta web site but when i try to start it, it says that the java-home has not been defined. I have my jdk installed already but I really have no clue how to set the java_home or even the clath_path. I am not sure where to go to do that. And when I open my command prompt and type java_home, it says that java is not a recognized command or something like that. can you please let me know why i am having that. Do I need to install linux as well? How do I know I already have linux or not.
Please, I am new to all this so I really need simple detailed explanations.
Thanks! :roll:
Adrian Yan
Ranch Hand

Joined: Oct 02, 2000
Posts: 688
errr... Do you know what OS you are running? type in uname -a, it should tell you what it is.
JAVA_HOME is a environment variable. In console, type in echo $JAVA_HOME. If nothing shows, that means you don't have it. It basically tells when the JAVA is installed.
My box:
xxx@XXXXXX:~$ echo $JAVA_HOME
/usr/local/share/j2sdk1.4.2_01
you can set this variables in the script that starts tomecat.
If you are using BASH (echo $SHELL), put in this:
JAVA_HOME=/usr/local/share/j2sdk1.4.2_01 (or depends on your machine)
export JAVA_HOME
If you are using CSH, put in this:
setenv JAVA_HOME /usr/local/share/j2sdk1.4.2_01
then try to start tomcat.
If you have more problem, just print out the error message, it's easier to debug for us.
Gloria Hans
Greenhorn

Joined: Nov 06, 2003
Posts: 18
Well, I am running Windows 2000. My JDK is in my c drive(jesdk1.4.2 is the folder). I enter the command echo $JAVA_HOME and it returned $JAVA_HOME.
In my bin folder in tomcat, I have batch file called startup. I entered the line set java_home = /usr/local/share/j2sdk1.4.2_01 but when I start my tomcat again I have this error:
Cannot find the file '-Dsun.io.useCanonCaches=false'(or one of its components).Make sure the path and filename are correct and that all required libraries are available.
In The same bin folder there is another file named setclasspath.sh but I did not touch it.
What are the libraries that are needed?
Sould I enter set the java_home in the setclasspath file?

:roll: :roll:
Gloria Hans
Greenhorn

Joined: Nov 06, 2003
Posts: 18
when I start tomcat from the command line, this is what I get
C:\Tomcat\Tomcat\bin>startup
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
Using CATALINA_BASE: ..
Using CATALINA_HOME: ..
Using CATALINA_TMPDIR: ..\temp
Using JAVA_HOME: /usr/local/share/j2sdk1.4.2_01
The system cannot find the file -Dsun.io.useCanonCaches=false.
C:\Tomcat\Tomcat\bin>
Han You
Greenhorn

Joined: Oct 26, 2003
Posts: 25
To set the java home environment variable, go to "System" on your control panel, and click the advanced tab. At the bottom of the dialogue box, there should be a button called environment variables. Click that, and another dialogue box should show up. In the new dialogue box, the top half should have stuff about "User variables", but just ignore that, because the JAVA_HOME variable has to be a system variable. In the bottom half of the dialogue box, there should be a new button. Click that and for the variable name, enter JAVA_HOME. For the variable value put the location of your jdk. (These directions are for win XP, but 2000 should be similar.)
Gloria Hans
Greenhorn

Joined: Nov 06, 2003
Posts: 18
ourahhhhhhhhhhhhhhh Ca marche!!!
Hey guys, My tomcat is working perfectly now . My supervisor heard me jumpign in my office and yelling in french; just set my catalina_home to tomcat and set my java_home pointing to my jdk in my starup file and it actually worked
Well, i will probably come back for something else
thank you guys!!
Adrian Yan
Ranch Hand

Joined: Oct 02, 2000
Posts: 688
I'm sorry about the confusion, the command I listed were for Linux, and I tho you were asking setting up Linux java and tomcat. My fault.
Sonny Gill
Ranch Hand

Joined: Feb 02, 2002
Posts: 1211

boy....you guys are a patient lot...
no offence to you Marcy, but in a situation like the one you were in, you should check out the biggener guides, install notes etc, you can find quite a few of these on Sun's site. It is a basic courtesy to try other resources before you post your problem on a forum.
It often helps to simplify things as much as you can. Just install JDK first, make it run. then install tomcat, make that run, and so on. Eventually, you will be running into problems that you cant find answers to by posting on a forum, that is when this kind of practice will come in handy.
all the best
p.s. Do you know what RTFM means . hope u dont take offence


The future is here. It's just not evenly distributed yet. - William Gibson
Consultant @ Xebia. Sonny Gill Tweets
Gloria Hans
Greenhorn

Joined: Nov 06, 2003
Posts: 18
Sandeep Gill,
I believe no question is ever too stupid. And if I've found out about this forum it because I've done some research on my own before I exposed my question here. And yes, I did RTFM before I asked my question. I just neeeded simpler explanation.
Take care
George Brown
Ranch Hand

Joined: Sep 26, 2000
Posts: 919
Marcy,
Please post Windows 2000 java questions to a more general forum. People are being misled by your posting in an inappropriate forum.
In future please post beginner questions of a non-linux/unix nature to 'Java in General (beginner)'.
Thankyou.
[ November 12, 2003: Message edited by: George Brown ]
Sonny Gill
Ranch Hand

Joined: Feb 02, 2002
Posts: 1211

ahhh...my sincerest appologies Marcy KL.
I was just misled into believing that you didnt do any research by the way you asked your question.
Incidently, now i am sure you know this because you did the research, on windows you use %VAR% sign to get the value of an environment variable, as in %CLASSPATH%, the $ sign is used in *nixes.
btw, you may find this an interesting read
http://www.catb.org/~esr/faqs/smart-questions.html
...on the other hand, you may not
take care
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jdk, linux, tomcat and all please help
 
Similar Threads
Removin java version 1.3.1 off my linux
Tomcat setup on Linux
Problems installing Tomcat/XP
tomcat.4.1.27.exe execution
How to install JSK and JDBC?? Very confused