Simple Shell Script Question.... [java related]

Reply

Join Date: Dec 2007
Posts: 1
Reputation: Drags111 is an unknown quantity at this point 
Solved Threads: 0
Drags111 Drags111 is offline Offline
Newbie Poster

Simple Shell Script Question.... [java related]

 
0
  #1
Dec 21st, 2007
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:
Shell Scripting Syntax (Toggle Plain Text)
  1. java -classpath ./:./jars/tools.jar:./jars/nexus.jar impsoft.nexus.installer.Install
  2.  
  3. chmod a+x run.sh compile.sh

The Error:
Shell Scripting Syntax (Toggle Plain Text)
  1. Exception in thread "main" java.lang.NoClassDefFoundError: impsoft/nexus/installer/Install

What I think the problem is:
Shell Scripting Syntax (Toggle Plain Text)
  1. ./jars/nexus.jar impsoft.nexus.installer.Install

Thank you for ALL of your help!
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 399
Reputation: eggi will become famous soon enough eggi will become famous soon enough 
Solved Threads: 47
eggi eggi is offline Offline
Posting Whiz

Re: Simple Shell Script Question.... [java related]

 
0
  #2
Dec 23rd, 2007
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
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!
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 399
Reputation: eggi will become famous soon enough eggi will become famous soon enough 
Solved Threads: 47
eggi eggi is offline Offline
Posting Whiz

Re: Simple Shell Script Question.... [java related]

 
0
  #3
Dec 23rd, 2007
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
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!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Shell Scripting Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC