| View previous topic :: View next topic |
| Author |
Message |
KevinRobinson Guest
|
Posted: Wed Jan 10, 2007 2:47 pm Post subject: CLASSPATH + Linux |
|
|
Hi,
Can anyone please tell me how to add or change a Java classpath in SUSE
Linux 9.3.
I have set up a Tomcat server but my Java Classes will not run although they
do on a windows box.
Kevin |
|
| Back to top |
|
 |
KevinRobinson Guest
|
Posted: Wed Jan 10, 2007 7:21 pm Post subject: Re: CLASSPATH + Linux |
|
|
Not sure what that means. Do I create a new file and add the classpath too
it?
If so where should the file go?
Regards
Kevin
"Pete Mullins" <pmullin (AT) attglobal (DOT) net> wrote in message
news:rsKdneaNjY06TDnYRVnyugA (AT) bt (DOT) com...
| Quote: | KevinRobinson wrote:
Hi,
Can anyone please tell me how to add or change a Java classpath in SUSE
Linux 9.3.
I have set up a Tomcat server but my Java Classes will not run although
they do on a windows box.
Kevin
setclasspath.sh
--
_______________________________
Pete Mullins |
|
|
| Back to top |
|
 |
HT de Beer Guest
|
Posted: Thu Jan 11, 2007 8:10 am Post subject: Re: CLASSPATH + Linux |
|
|
KevinRobinson wrote:
| Quote: | Can anyone please tell me how to add or change a Java classpath in SUSE
Linux 9.3.
|
In a shell you can set the CLASSPATH environment variable
export CLASSPATH=$CLASSPATH:\path\to\new\files\to\include\in\the\classpath
You can also call java with the -cp (classpath option)
java -cp=\path\to\new\files\to\include\in\the\classpath javaprogram
| Quote: | I have set up a Tomcat server but my Java Classes will not run although
they do on a windows box.
|
Have a look at the documentation of the tomcat server. I am sure it will
mention how to use it on linux.
--
HT de Beer
H.T.de.Beer (AT) gmail (DOT) com |
|
| Back to top |
|
 |
HT de Beer Guest
|
Posted: Thu Jan 11, 2007 8:10 am Post subject: Re: CLASSPATH + Linux |
|
|
HT de Beer wrote:
Hmm, wrong slashes ... Damn, I too often get them wrong ,
| Quote: | KevinRobinson wrote:
Can anyone please tell me how to add or change a Java classpath in SUSE
Linux 9.3.
In a shell you can set the CLASSPATH environment variable
export CLASSPATH=$CLASSPATH:\path\to\new\files\to\include\in\the\classpath
|
export CLASSPATH=$CLASSPATH:/path/to/new/files/to/include/in/the/classpath
| Quote: |
You can also call java with the -cp (classpath option)
java -cp=\path\to\new\files\to\include\in\the\classpath javaprogram
|
java -cp=/path/to/new/files/to/include/in/the/classpath javaprogram
--
HT de Beer
H.T.de.Beer (AT) gmail (DOT) com |
|
| Back to top |
|
 |
Pete Mullins Guest
|
Posted: Thu Jan 11, 2007 8:10 am Post subject: Re: CLASSPATH + Linux |
|
|
KevinRobinson wrote:
| Quote: | Not sure what that means. Do I create a new file and add the classpath too
it?
If so where should the file go?
Regards
Kevin
"Pete Mullins" <pmullin (AT) attglobal (DOT) net> wrote in message
news:rsKdneaNjY06TDnYRVnyugA (AT) bt (DOT) com...
KevinRobinson wrote:
Hi,
Can anyone please tell me how to add or change a Java classpath in SUSE
Linux 9.3.
I have set up a Tomcat server but my Java Classes will not run although
they do on a windows box.
Kevin
setclasspath.sh
--
_______________________________
Pete Mullins
|
Sorry Kevin,
There should be a skeleton included with the tomcat install:
/usr/share/tomcat5/bin/setclasspath.sh
You can edit this and add your classpath entry. You can still use the
WEB-INF/classes or WEB-INF/lib folders as usual. e.g.:
/usr/share/tomcat5/webapps/ROOT/WEB-INF
--
_______________________________
Pete Mullins |
|
| Back to top |
|
 |
Pete Mullins Guest
|
Posted: Thu Jan 11, 2007 8:10 am Post subject: Re: CLASSPATH + Linux |
|
|
KevinRobinson wrote:
| Quote: | Hi,
Can anyone please tell me how to add or change a Java classpath in SUSE
Linux 9.3.
I have set up a Tomcat server but my Java Classes will not run although
they do on a windows box.
Kevin
|
setclasspath.sh
--
_______________________________
Pete Mullins |
|
| Back to top |
|
 |
KevinRobinson Guest
|
Posted: Thu Jan 11, 2007 3:19 pm Post subject: Re: CLASSPATH + Linux |
|
|
Thanks for this but it still won't work.
If I type env in the console the CLASSPATH appears in the list of variables
but only if it is entered in the alljava.sh.
If I put it in the setclasspath.sh and do env then CLASSPATH doesn't appear
in the variable list.
However whichever way I do it the app still won't work.
Kevin
"KevinRobinson" <k.s.robinson (AT) btinternet (DOT) com> wrote in message
news:2IadnRst3qitNTnYnZ2dnUVZ8sylnZ2d (AT) bt (DOT) com...
| Quote: | Hi,
Can anyone please tell me how to add or change a Java classpath in SUSE
Linux 9.3.
I have set up a Tomcat server but my Java Classes will not run although
they
do on a windows box.
Kevin
|
|
|
| Back to top |
|
 |
Lew Guest
|
Posted: Sat Jan 13, 2007 8:10 am Post subject: Re: CLASSPATH + Linux |
|
|
Lew wrote:
| Quote: | Backslash will always be an escape for me.
|
I should have read your next post, sorry.
- Lew |
|
| Back to top |
|
 |
Lew Guest
|
Posted: Sat Jan 13, 2007 8:10 am Post subject: Re: CLASSPATH + Linux |
|
|
KevinRobinson wrote:
| Quote: | Can anyone please tell me how to add or change a Java classpath in SUSE
Linux 9.3.
|
HT de Beer wrote:
| Quote: | export CLASSPATH=$CLASSPATH:\path\to\new\files\to\include\in\the\classpath
|
That will not work - in Linux / UNIX the path separator is the forward slash,
not the backslash, Windows also accepts forward slashes now, so there is no
excuse any more to use backslash as a path separator character.
Backslash will always be an escape for me.
- Lew |
|
| Back to top |
|
 |
Joe Schlobotnick Guest
|
Posted: Thu Feb 01, 2007 8:38 pm Post subject: Re: CLASSPATH + Linux |
|
|
The setclasspath.sh that comes with Tomcat should set the classpath used
by the server...it shouldn't affect what you see when you type env.
After adding your path the setclasspath.sh, you probably need to stop
and start Tomcat to pick up the change.
Joe
KevinRobinson wrote:
| Quote: | Thanks for this but it still won't work.
If I type env in the console the CLASSPATH appears in the list of variables
but only if it is entered in the alljava.sh.
If I put it in the setclasspath.sh and do env then CLASSPATH doesn't appear
in the variable list.
However whichever way I do it the app still won't work.
Kevin
"KevinRobinson" <k.s.robinson (AT) btinternet (DOT) com> wrote in message
news:2IadnRst3qitNTnYnZ2dnUVZ8sylnZ2d (AT) bt (DOT) com...
Hi,
Can anyone please tell me how to add or change a Java classpath in SUSE
Linux 9.3.
I have set up a Tomcat server but my Java Classes will not run although
they
do on a windows box.
Kevin
|
|
|
| Back to top |
|
 |
|