|
|
|
|
|
|
| Author |
Message |
weaselboy1976 *nix forums beginner
Joined: 18 Feb 2005
Posts: 2
|
Posted: Fri Feb 18, 2005 12:52 pm Post subject:
Re: Execution error java prog inside shell script
|
|
|
Martin Caldwell wrote:
| Quote: | When I execute a java program from the command line
/test/mypath>java myprog
everything is fine. If I put the same statement into shell script (in
the same directory)
the execution fails with an error
Exception in thread "main" java.lang.NoClassDefFoundError:
/test/mypath/myprog
What's wrong?
Martin
|
The environment variables aren't passed to your script. Try setting or
exporting PATH and CLASSPATH in your script. |
|
| Back to top |
|
 |
Heiner Steven *nix forums Guru Wannabe
Joined: 19 Feb 2005
Posts: 170
|
Posted: Thu Feb 17, 2005 9:57 pm Post subject:
Re: Execution error java prog inside shell script
|
|
|
Martin Caldwell wrote:
| Quote: | When I execute a java program from the command line
/test/mypath>java myprog
everything is fine. If I put the same statement into shell script (in the same directory)
the execution fails with an error
Exception in thread "main" java.lang.NoClassDefFoundError: /test/mypath/myprog
What's wrong?
|
Maybe your CLASSPATH is set correctly, but not exported (using "export
CLASSPATH")? In this case the current shell had the right settings
for CLASSPATH, but any subshell (e.g. a shell script) would not
get the settings exported, but get e.g. an empty CLASSPATH.
Heiner
--
___ _
/ __| |_ _____ _____ _ _ Heiner STEVEN <heiner.steven@nexgo.de>
\__ \ _/ -_) V / -_) ' \ Shell Script Programmers: visit
|___/\__\___|\_/\___|_||_| http://www.shelldorado.com/ |
|
| Back to top |
|
 |
Martin Caldwell *nix forums beginner
Joined: 17 Feb 2005
Posts: 2
|
Posted: Thu Feb 17, 2005 9:36 pm Post subject:
Execution error java prog inside shell script
|
|
|
When I execute a java program from the command line
/test/mypath>java myprog
everything is fine. If I put the same statement into shell script (in the same directory)
the execution fails with an error
Exception in thread "main" java.lang.NoClassDefFoundError: /test/mypath/myprog
What's wrong?
Martin |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Thu Jan 08, 2009 9:43 pm | All times are GMT
|
|
Watch Anime Online | Neopets Cheats, Games and Neopoints | Mortgages | Bad Credit Credit Cards | MPAA
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
|
|
Other DeniX Solutions sites:
Unix/Linux blog |
electronics forum |
medicine forum |
science forum |
|
|
Privacy Policy
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|