S
Stan Goodman
I'm sure that this is not really on-topic for this group, but forums I
would have thought to be more appropriate yield unhelpful, inaccurate
or no repliies at all. Evidently, few groups are frequented by people
that understand both Java and Linux shell scripts.
I have written the following short script in SUSE Linux v9.3. I see
nothing wrong with either of its two lines, yet each line gets an
error message. I would be grateful if someone can tell me why. If
someone can also throw light on the reason that, despite the fact that
it is executable and that it contains the requisite first line, it
refuses to run; when I type its name (from the directory in which it
resides, I am informed that there is no such file. For the time being,
I run it as ". run", which works.
*****
#! /bin/bash
#
cd /home/stan/bin/genj
java -classpath ./lib/genj.jar genj.app.App
*****
Firstly, the cd line doesn't work at all. It gets an error message
saying "no such file or directory". There IS such a directory, and I
am running the script from it. Since this is an absolute directory
specification, it should leave me just where I am, and make no
complaint. But it doesn't matter what directory I specify, I get the
same error message.
The jave line gets an error message from the JVM, indicating that it
couldn't find class genj.app.App. I have used this application under
another OS, and know that this class is the entry point; the jar file
is where the script says it is, and this is its name. The lib
directory is, as it says, one directory down from the directory I am
in (and which the cd line was meant to bring me to if I had started
from some other directory). These two logether work in other OSes,
given only the obvious directory changes from system to system, and
turning "/" into "\". The JVM is v1.5.0_04.
What's wrong?
TIA
would have thought to be more appropriate yield unhelpful, inaccurate
or no repliies at all. Evidently, few groups are frequented by people
that understand both Java and Linux shell scripts.
I have written the following short script in SUSE Linux v9.3. I see
nothing wrong with either of its two lines, yet each line gets an
error message. I would be grateful if someone can tell me why. If
someone can also throw light on the reason that, despite the fact that
it is executable and that it contains the requisite first line, it
refuses to run; when I type its name (from the directory in which it
resides, I am informed that there is no such file. For the time being,
I run it as ". run", which works.
*****
#! /bin/bash
#
cd /home/stan/bin/genj
java -classpath ./lib/genj.jar genj.app.App
*****
Firstly, the cd line doesn't work at all. It gets an error message
saying "no such file or directory". There IS such a directory, and I
am running the script from it. Since this is an absolute directory
specification, it should leave me just where I am, and make no
complaint. But it doesn't matter what directory I specify, I get the
same error message.
The jave line gets an error message from the JVM, indicating that it
couldn't find class genj.app.App. I have used this application under
another OS, and know that this class is the entry point; the jar file
is where the script says it is, and this is its name. The lib
directory is, as it says, one directory down from the directory I am
in (and which the cd line was meant to bring me to if I had started
from some other directory). These two logether work in other OSes,
given only the obvious directory changes from system to system, and
turning "/" into "\". The JVM is v1.5.0_04.
What's wrong?
TIA