on 03-07-2006 1:37 AM
i have some jar files in a folder ,so i want to set their path to Java.class.path, so some deployed Applications can load and call classes packed in them ? where can i config the classpath and how to config them?
thanks very much.
Set JAVA_HOME path and Class path (upto jdk/lib folder) details in environment variable. it should work
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Guoging,
there are at least to ways to make jars available for applications
1) Creating a server lib and letting your apps reference this lib, giving access to all the classes, it contains
2) Packaging the jars with your apps, makeing them kind of private to your apps:
- for web apps, put the jars in the WEB-INF/lib folder
- for j2ee and webdynpro apps, put the jars in the lib folder
Regards
Gregor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
All you need to do is to define CLASSPATH environment variable specifing the path to your JARs. It should work on Windows or Unix both.
Regards,
Mike
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
following your reply, i try it, but it don't work,
i do a test
public class SayHello{
public static String say(){
return "hello,world"
}
i package this class into sayhello.jar and set its path into the classpath.
in a webapplication, in a doGet method of servlet ,i call SayHello.say(),some exceptions be thrown. java.lang.ClassNotFoundError.
how do you do them ? please give me some info in details ,thanks
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.