19-classpath, jar, module

the CLASSPATH 
the CLASSPATH JVM is an environment variable used, it is used to indicate how the JVM search class, under normal circumstances without setting classpath! The current default directory. Are good enough in most cases. 

jar package 
jar package can package the directory hierarchy of the organization, as well as all the files in each directory (including .class files and other files) are labeled as a jar file. 
jar package is actually a zip format compressed files, and jar package equivalent to the directory. In Explorer, find the correct directory, produced a zip. Then, the suffix from .zip to .jar. 
jar package may further comprise a special /META-INF/MANIFEST.MF file, MANIFEST.MF plain text, can be specified Main- Class and other information, while the inclusion of other jar package jar, required in the MANIFEST.MF file Configuring classpath. In large projects, writing is impossible manually MANIFEST.MF file, and then manually create the zip package. There will be other open source build tool. 

Modules 
starting from Java 9, JDK and the introduction of the module (Module). The pile of packages is the class is merely a jar packaging process, and the modules are packaged as a stack class only needs to be packaged, but also to write dependencies, and may further comprise binary code (typically extension JNI). In addition, the module supports multiple versions that can provide different versions for different JVM in the same module. And it only exported package declarations, are allowed to access external code, and further isolated the access code. 
Write module HTTPS: // www.liaoxuefeng.com/wiki/1252599548343744/1281795926523938
ide HTTPS directly generate JDR: // www.cnblogs.com/wuxu/p/10297038.html

 

Guess you like

Origin www.cnblogs.com/nsss/p/11417548.html