Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 07/05/2008, à 10:32

Danacool

Installation TOMCAT

Bonjour,
Dans ma démarche d' installation de Tomcat, j'ai suivie les étapes suivante :

1- jai installé Java SDK dans le repertoire: /opt/SDK.
la commande :

java -version

me revois maintenant ce résultat:

java version "1.6.0_06"
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) Client VM (build 10.0-b22, mixed mode)

Par la suite, j'ai ajouté la ligne suivante dans le fichier /etc/profile :

exporte JAVA_HOME=/opt/SDK/

2- Apres, j'ai telechargé apache_tomcat sur le site d'apache, je l'ai decompressé dans le répertoire : /opt/jakarta.
Dans le fichier catalina.sh, j'ai ensuite inseré la ligne suivante:

JAVA_HOME=/opt/SDK

quand je fait :

/opt/jakarta/apache-tomcat-6.0.16/bin/startup.sh

j'obtient le résultat suivant

Using CATALINA_BASE:   /opt/jakarta/apache-tomcat-6.0.16
Using CATALINA_HOME:   /opt/jakarta/apache-tomcat-6.0.16
Using CATALINA_TMPDIR: /opt/jakarta/apache-tomcat-6.0.16/temp
Using JRE_HOME:       /home/danacool/Desktop/jdk1.6.0_06/

est ce normal que la variable JRE_HOME point sur un repertoire qui n'existe pas?hmm:/:/

quand je regarde le fichier log de Tomcat, j'ai ça:

/opt/jakarta/apache-tomcat-6.0.16/bin/catalina.sh: 356: /home/danacool/Desktop/jdk1.6.0_06//bin/java: not found

Auriez vous une petite idée d'où viens ce pb???
Merci

#2 Le 07/05/2008, à 17:22

garnier

Re : Installation TOMCAT

Bonsoir,

1/ Corrige dans ton fichier /etc/profile la ligne suivante :

exporte JAVA_HOME=/opt/SDK/

en

export  JAVA_HOME=/opt/SDK/

2/ La variable JRE_HOME ne signalise pas toute seule, donc recherche dans les différents fichiers ci-dessous cette variable, voir JAVA_HOME également :

- /etc/profile
- /etc/bash*
-  ton .bashrc
-  ton .profile
idem pour .basrc et .profile de l'utilisateur root si tu lance tomcat comme root

3/ Déclare au début du fichier catalina.sh ta variable JRE_HOME et/ou JAVA_HOME

catalina.sh

#!/bin/sh

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# -----------------------------------------------------------------------------
# Start/Stop Script for the CATALINA Server
#
# Environment Variable Prequisites
#
#   CATALINA_HOME   May point at your Catalina "build" directory.
#
#   CATALINA_BASE   (Optional) Base directory for resolving dynamic portions
#                   of a Catalina installation.  If not present, resolves to
#                   the same directory that CATALINA_HOME points to.
#
#   CATALINA_OPTS   (Optional) Java runtime options used when the "start",
#                   or "run" command is executed.
#
#   CATALINA_TMPDIR (Optional) Directory path location of temporary directory
#                   the JVM should use (java.io.tmpdir).  Defaults to
#                   $CATALINA_BASE/temp.
#
#   JAVA_HOME       Must point at your Java Development Kit installation.
#                   Required to run the with the "debug" or "javac" argument.
#
#   JRE_HOME        Must point at your Java Development Kit installation.
#                   Defaults to JAVA_HOME if empty.
#
#   JAVA_OPTS       (Optional) Java runtime options used when the "start",
#                   "stop", or "run" command is executed.
#
#   JPDA_TRANSPORT  (Optional) JPDA transport used when the "jpda start"
#                   command is executed. The default is "dt_socket".
#
#   JPDA_ADDRESS    (Optional) Java runtime options used when the "jpda start"
#                   command is executed. The default is 8000.
#
#   JPDA_SUSPEND    (Optional) Java runtime options used when the "jpda start"
#                   command is executed. Specifies whether JVM should suspend
#                   execution immediately after startup. Default is "n".
#
#   JPDA_OPTS       (Optional) Java runtime options used when the "jpda start"
#                   command is executed. If used, JPDA_TRANSPORT, JPDA_ADDRESS,
#                   and JPDA_SUSPEND are ignored. Thus, all required jpda
#                   options MUST be specified. The default is:
#
#                   -Xdebug -Xrunjdwp:transport=$JPDA_TRANSPORT,
#                       address=$JPDA_ADDRESS,server=y,suspend=$JPDA_SUSPEND
#
#   JSSE_HOME       (Optional) May point at your Java Secure Sockets Extension
#                   (JSSE) installation, whose JAR files will be added to the
#                   system class path used to start Tomcat.
#
#   CATALINA_PID    (Optional) Path of the file which should contains the pid
#                   of catalina startup java process, when start (fork) is used
#
# $Id: catalina.sh 600664 2007-12-03 20:24:19Z jim $
# -----------------------------------------------------------------------------
JAVA_HOME=/opt/SDK
JRE_HOME=/opt/SDK/jre

REMARQUE: la JRE_HOME est utilisée de préférence à JAVA_HOME par tomcat si les deux variables sont déclarées.

cordialement benoit