Hi Susan:
:-) You for valuable contribution to my learning curve!
According to Brian Leonard's Blog here are the steps
for starting the Derby Server:

  1. Download the latest official Derby release (10.1.2.1 at the time of this writing) and extract the archive.
  2. Set the DERBY_INSTALL environment variable to point to your Derby installation location. For me this is D:\db-derby-10.1.2.1-bin.
1.+2. = done.

Start the Derby Server
  1. Open a command prompt and switch to the $DERBY_INSTALL/frameworks/NetworkServer/bin directory.
  2. Execute the setNetworkServerCP script, which sets the necessary Derby jars on the classpath.
  3. Execute the startNetworkServer script to start Derby. You should then see something like the following:



1. Here are the files in bin:
[EMAIL PROTECTED] ~]$ cd /$DERBY_INSTALL/frameworks/NetworkServer/bin
[EMAIL PROTECTED] bin]$ ls -l
total 136
-rwxr-xr-x  1 dan dan 1113 Nov  2 13:44 dblook.bat
-rwxr-xr-x  1 dan dan  922 Nov  2 13:44 dblook.ksh
-rwxr-xr-x  1 dan dan 1510 Nov  2 13:44 ij.bat
-rwxr-xr-x  1 dan dan 1161 Nov  2 13:44 ij.ksh
-rwxr-xr-x  1 dan dan 1213 Nov  2 13:44 NetworkServerControl.bat
-rwxr-xr-x  1 dan dan  986 Nov  2 13:44 NetworkServerControl.ksh
-rwxr-xr-x  1 dan dan  716 Nov  2 13:44 setNetworkClientCP.bat
-rwxr-xr-x  1 dan dan  615 Nov  2 13:44 setNetworkClientCP.ksh
-rwxr-xr-x  1 dan dan  742 Nov  2 13:44 setNetworkServerCP.bat
-rwxr-xr-x  1 dan dan  642 Nov  2 13:44 setNetworkServerCP.ksh
-rwxr-xr-x  1 dan dan 1543 Nov  2 13:44 startNetworkServer.bat
-rwxr-xr-x  1 dan dan 1699 Apr  5 09:37 startNetworkServer.ksh
-rwxr-xr-x  1 dan dan 1702 Apr  5 09:35 startNetworkServer.ksh~
-rwxr-xr-x  1 dan dan 1806 Nov  2 13:44 stopNetworkServer.bat
-rwxr-xr-x  1 dan dan 1697 Nov  2 13:44 stopNetworkServer.ksh
-rwxr-xr-x  1 dan dan 1307 Nov  2 13:44 sysinfo.bat
-rwxr-xr-x  1 dan dan 1255 Nov  2 13:44 sysinfo.ksh

2. Executing setNetworkServerCP results in
[EMAIL PROTECTED] bin]$ ./setNetworkServerCP.ksh
[EMAIL PROTECTED] bin]$
i.e. 'nothing' (visible)

3. Executing startNetworkServer results in
[EMAIL PROTECTED] bin]$   ./startNetworkServer.ksh
./startNetworkServer.ksh: line 56: /usr/java/bin/java: No such file or [EMAIL PROTECTED] bin]$

I attach the setNetworkServerCP.ksh and startNetworkServer.ksh files
My present PATHs and CLASSPATHs are resp:
PATH
[EMAIL PROTECTED] bin]$ echo $PATH
/usr/java/jdk1.5.0_04:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/dan/bin
[EMAIL PROTECTED] bin]$
(I've added /usr/java/jdk1.5.0_04 to the PATH acc to your recommendation)
CLASSPATH
[EMAIL PROTECTED] bin]$ echo $CLASSPATH
/home/dan/mysql-connector-java-3.1.10.tar.gz_FILES/mysql-connector-java-3.1.10/mysql-connector-java-3.1.10-bin.jar:
/home/dan/mysql-connector-java-3.1.10.tar.gz_FILES/mysql-connector-java-3.1.10/mysql-connector-java-3.1.10-bin-g.jar:
/home/dan/cos-05Nov2002.zip_FILES/lib/cos.jar
[EMAIL PROTECTED] bin]$

Help! /dan

--- Begin Message ---
Hi Dan,

See my comments interleaved in your message below.

Susan

--- dan <[EMAIL PROTECTED]> wrote:

> >From the getstartderby.pdf:
> "You need to set your PATH environment variable so the JVM and Java
> applications run
> correctly. This is extremely important for the success of your
> installation because the
> PATH variable enables your operating system to find the appropriate
> programs from any
> directory. If you have more than one JVM installed, the JVM you want to
> use must appear
> before any of the others in the PATH variable.
> To check the PATH environment variable:
>   1. In a command window, type the following:
>       java -version
>       If the path is set correctly, you will see a printout telling you
> the version of your JVM.
>   2. If the command does not return the correct version of your JVM, set
> the PATH
>       variable by adding the bin subdirectory of the JVM directory to
> the beginning of the
>       path.
>       For example, if the directory is C:\JDK1.4, add C:\JDK1.4\bin to
> the beginning
>       of the path.
>   3. Repeat step 1 to make sure the PATH environment variable is set
> correctly."
> 
> command
> java -version
> results in (I'm on Linux, Fedora Core 4):
> "
> $ java -version
> java version "1.4.2"
> gij (GNU libgcj) version 4.0.0 20050519 (Red Hat 4.0.0-8)

So currently your PATH variable is most likely pointing to 
the /usr/java/j2sdk1.4.2_09 installation.

Since java -version shows the version 1.4.2, it means that
java is found in your path already.

> In my /usr/java I have the folders
> j2sdk1.4.2_09
> jdk1.5.0_04
> jre1.5.0_04
> 
> but I have no JAVA_HOME when I
> echo $JAVA_HOME

Unless you have a need to set JAVA_HOME for some other application or
program (I could not find a reference to JAVA_HOME in the Getting Started
Guide) you do not need to set it for Derby.

If you want to set JAVA_HOME and you are running with a Borne or Korn
shell on Linux (as long as it is not csh) the following command will
set your JAVA_HOME environment variable:

$export JAVA_HOME=/usr/java/j2sdk1.4.2_09

> 
> >2. If the command does not return the correct version of your JVM, set
> the PATH
>       >variable by adding the bin subdirectory of the JVM directory to
> the beginning of the
>       >path.
> How do manage #2? /dan

Your PATH variable is set to a bin directory of a JVM, however it may  not
be the one you want based on your comments.

To see your current PATH type this:

$ echo $PATH

the output should be something like this (this is an example from my linux box):

sh-2.05b$ echo $PATH
/opt/kde3/bin:/opt/gnome/bin:/usr/games:/usr/bin/X11:/usr/local/bin:/usr/bin:/bin:/usr/lib/java/jre/bin

Also, if you use the 'which' command you should be able to see which java 
executable
your PATH includes.

sh-2.05b$ which java
/usr/lib/java/jre/bin/java

Now, if you want to change your PATH to pick up a different version of Java,
for instance, if you wanted to use your /usr/java/jdk1.5.0_04 version,
this command would work to set the PATH:

$ export PATH=/usr/java/jdk1.5.0_04/bin:$PATH



--- End Message ---
# ---------------------------------------------------------
# -- This script file sets the CLASSPATH environment variable
# -- for use with Derby products in NetworkServer mode
# --
# -- To use this script from other locations, change the 
# -- value assigned to DERBY_INSTALL to be an absolute path 
# -- (export DERBY_INSTALL=/opt/derby) instead of the current relative path
# --
# -- This file for use on Unix ksh systems
# -- 
# ---------------------------------------------------------
# DERBY_INSTALL=

export 
CLASSPATH="${DERBY_INSTALL}/lib/derby.jar:${DERBY_INSTALL}/lib/derbytools.jar:${DERBY_INSTALL}/lib/derbynet.jar:${CLASSPATH}"
## ---------------------------------------------------------
# -- This simple script is an example of how to start Derby
# -- as a server inside the Network Server framework
# --
# -- REQUIREMENTS:
# --     You must have the derby and Network Server jar files in your CLASSPATH
# --
# --  Check the setNetworkServerCP.ksh file for an example of
# --   what to set.
# --
# -- This file for use on Unix ksh systems
# ---------------------------------------------------------
# ---------------------------------------------------------
# -- start Derby Network Server
# ---------------------------------------------------------

# DERBY_INSTALL=

[ -z "$CLASSPATH" ] && {
  . "$DERBY_INSTALL"/frameworks/NetworkServer/bin/setNetworkServerCP.ksh
}

if [ -z "$JAVA_HOME" ]
then
   JAVA_HOME=/usr/java
fi

# ---------------------------------------------------------
# -- Determine the host and port to use by:
# --  1. Check to see if the host and port are set on the command line
# --  2. Check to see if DERBY_SERVER_HOST and DERBY_SERVER_PORT
# --  3. Default to localhost/1527
# ---------------------------------------------------------

if [  "$1" ]
then
   DERBY_SERVER_HOST=$1
fi

if [ -z "$DERBY_SERVER_HOST" ]
then
   DERBY_SERVER_HOST=localhost
fi

if [  "$2" ]
then
   DERBY_SERVER_PORT=$2
fi

if [ -z "$DERBY_SERVER_PORT" ]
then
   DERBY_SERVER_PORT=1527
fi


$JAVA_HOME/bin/java org.apache.derby.drda.NetworkServerControl start -h 
$DERBY_SERVER_HOST -p $DERBY_SERVER_PORT

# ---------------------------------------------------------
# -- To use a different JVM with a different syntax, simply edit
# -- this file
# ---------------------------------------------------------

Reply via email to