Originally posted by William Yan: And what about a file, when i wirte a class that uses another file, say a .txt file, and put all the manifest, .txt, .class all in a jar. But i cannot use it. Must the .txt be put outside the jar?
Yes, you may place other types of files in a jar file. However, if you do, you will need the classloader to get the file since the File class only deal with files in the filesystem.
See the getResourceAsStream() method of the java.lang.Class class.