| | |
Simple Shell Script Question.... [java related]
![]() |
•
•
Join Date: Dec 2007
Posts: 1
Reputation:
Solved Threads: 0
Hey guys! This is my first post, as im new here 
I have a simple problem for a big program.
We have a .sh to install it, but when I run the .sh in terminal like i should, It says the class is not found. I believe it has to do with the syntax, as the person who made it is not a linux pro. I don't know MUCH about shell scripts, but I'm pretty sure I know where the error lies.
Our Script:
The Error:
What I think the problem is:
Thank you for ALL of your help!

I have a simple problem for a big program.
We have a .sh to install it, but when I run the .sh in terminal like i should, It says the class is not found. I believe it has to do with the syntax, as the person who made it is not a linux pro. I don't know MUCH about shell scripts, but I'm pretty sure I know where the error lies.
Our Script:
Shell Scripting Syntax (Toggle Plain Text)
java -classpath ./:./jars/tools.jar:./jars/nexus.jar impsoft.nexus.installer.Install chmod a+x run.sh compile.sh
The Error:
Shell Scripting Syntax (Toggle Plain Text)
Exception in thread "main" java.lang.NoClassDefFoundError: impsoft/nexus/installer/Install
What I think the problem is:
Shell Scripting Syntax (Toggle Plain Text)
./jars/nexus.jar impsoft.nexus.installer.Install
Thank you for ALL of your help!
•
•
Join Date: Oct 2007
Posts: 399
Reputation:
Solved Threads: 47
Hey There,
I think the problem might be in the classpath definition on the command line:
java -classpath ./:./jars/tools.jar:./jars/nexus.jar
Since all the paths start with "./" you'd have to be in the directory with the jars subdirectory when you run the install.sh script.
That's my first inclination. Let me know if that's off-base and I'll try to help you out some more. If possible, and it won't be a security problem for you, can you also past the output from
set
pwd
ls
while you're logged in. That might help me see the problem.
Best Wishes
, Mike
I think the problem might be in the classpath definition on the command line:
java -classpath ./:./jars/tools.jar:./jars/nexus.jar
Since all the paths start with "./" you'd have to be in the directory with the jars subdirectory when you run the install.sh script.
That's my first inclination. Let me know if that's off-base and I'll try to help you out some more. If possible, and it won't be a security problem for you, can you also past the output from
set
pwd
ls
while you're logged in. That might help me see the problem.
Best Wishes

, Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
•
•
Join Date: Oct 2007
Posts: 399
Reputation:
Solved Threads: 47
I'm sorry,
I hit return before I meant to. Also, try checking (with the "set" command), what your java classpath is set to in your environment. You should add that as $classpath or $CLASSPATH or $CATALINA_HOME, etc at the end of the colon (
separated classpath that you call on the command line. Since it's explicit, you may be unintentionally not including some basic jar files that you need to run the installer.
Thanks
, Mike
I hit return before I meant to. Also, try checking (with the "set" command), what your java classpath is set to in your environment. You should add that as $classpath or $CLASSPATH or $CATALINA_HOME, etc at the end of the colon (
separated classpath that you call on the command line. Since it's explicit, you may be unintentionally not including some basic jar files that you need to run the installer.Thanks

, Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
![]() |
Other Threads in the Shell Scripting Forum
- Previous Thread: email log parsing
- Next Thread: How to connect to mysql using shell script?
| Thread Tools | Search this Thread |





