your suggestion please. 1.when run java -jar client.jar db.db. Exception was thrown. 2.when I access remote server by run client.jar and try to show online help but client.jar can not find userguide.html. I put client.jar, db.db, userguide.html in the same dir starting\, summary: I can not access files outside client.jar. thanks in advance
Consider this. a jar file is the start of a path. The files that are inside the jar file have further path information. When you run the jar file with java -jar client.jar you are telling java that you have a manifest file in there that will point to the main class. However, you have not told java the classpath. This is really important to access outside files. Becuase java still needs to know where to find them, and it looks in the classpath, if the classpath is not set, and the files aren't where the classpath is set, then you will get your error. What is your classpath? Mark
Thank you very much. got your idea. somebody's online.html is put in a dir. starting\doc\online.html. the classpath is set at starting\. when I put file in classpath I can access them. but if I put them in a dir which in the classpath I don't know how to access them. could you give me some idea please thanks