If I add a .jar file to a classpath, then edit some content in the .jar file, can the content still be identified within the classpath?
Example, using Ant:
- Read a set of .class and .property files and create a .jar of them. The .jar file now contains the .class and .property files
- Add the .jar file to classpath
- Open the .jar file, edit a class file A.class and property file B.property
- Store the edited files in the .jar file and close it
Without re-defining the classpath, can files A and B still be found from the classpath? I.e. are files identified by some unique ID in the classpath (which has probably now changed since we edited the files) or by file name?
Thanks in advance for your help!
The files in classpath are identified by their unique names. So to answer your question:
Yes. The file (I believe that’s what you meant here – not the content) can be still identified, as long as it’s name didn’t change. Thus providing access to its content.
Also, I believe you thought about the .java file not .class file. Class files are stored in bytecode, which is machine-readable. Java files are the source code.