438,034 Members | 819 Online
Need help? Post your question and get tips & solutions from a community of 438,034 IT Pros & Developers. It's quick & easy.

# CLASSPATH + Linux

 P: n/a 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 Jan 10 '07 #1
9 Replies

 P: n/a 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 Jan 10 '07 #2

 P: n/a 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" Hi,Can anyone please tell me how to add or change a Java classpath in SUSELinux 9.3.I have set up a Tomcat server but my Java Classes will not run althoughthey do on a windows box.Kevin setclasspath.sh -- _______________________________ Pete Mullins Jan 10 '07 #3

 P: n/a KevinRobinson wrote: 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" KevinRobinson wrote: >>Hi,Can anyone please tell me how to add or change a Java classpath in SUSELinux 9.3.I have set up a Tomcat server but my Java Classes will not run althoughthey 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 Jan 10 '07 #4

 P: n/a 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 You can also call java with the -cp (classpath option) java -cp=\path\to\new\files\to\include\in\the\classpath javaprogram 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.*********@gmail.com Jan 11 '07 #5  P: n/a HT de Beer wrote: Hmm, wrong slashes ... Damn, I too often get them wrong , KevinRobinson wrote: >Can anyone please tell me how to add or change a Java classpath in SUSELinux 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 > 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.*********@gmail.com Jan 11 '07 #6  P: n/a 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"  P: n/a KevinRobinson wrote: >Can anyone please tell me how to add or change a Java classpath in SUSELinux 9.3. HT de Beer wrote: 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 Jan 13 '07 #8

 P: n/a Lew wrote: Backslash will always be an escape for me. I should have read your next post, sorry. - Lew Jan 13 '07 #9

 P: n/a 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: 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" Hi,Can anyone please tell me how to add or change a Java classpath in SUSELinux 9.3.I have set up a Tomcat server but my Java Classes will not run althoughtheydo on a windows box.Kevin Feb 1 '07 #10

### This discussion thread is closed

Replies have been disabled for this discussion.