This, in turn, means that source files from different directories can be compiled with the same command-line invocation. Indicating the root of the output tree, which is the same for all files, is sufficient. But it also means that there is no need to specify a -o option to indicate where output files should be placed. This means that make’s normal algorithm for associating a binary file with its source fails. Code declared to be within the a.b.c package would be compiled to class files in the a/b/c directory. For instance, the package a.b.c would implicitly define a directory structure a/b/c. Package names are hierarchical and implicitly define a file structure. A class is declared to be encapsulated in a package that forms a scope around the symbols defined by the file. Most large Java projects make extensive use of Java’s package feature. Instead, Java relies on sophisticated just-in-time (JIT) optimizations performed by the Java virtual machine (JVM) itself. A more modest performance improvement is due to the bare minimum of optimization performed by most Java compilers. In even medium-sized projects, this means the Java compiler can avoid rereading, parsing, and analyzing literally millions of lines of code compared with C. Because the symbols in a class file cannot change during the compilation process, the class files are cached by the compiler. However, rather than rereading source code, which then needs to be reparsed and analyzed, Java reads the class files directly. Similar to a #include in C, this directive is used to allow access to externally defined symbols. This is primarily due to the way the import directive works. This is primarily due to three factors: the Java compiler, javac, is extremely fast the standard Java compiler supports the syntax for reading “command-line parameters” from a file and if a Java package is specified, the Java language specifies a path to the. Using make with Java raises several issues and introduces some opportunities. This chapter explores the value of make in these situations in particular, it presents a generalized makefile that can be dropped into just about any Java project with minimal modification and carry out all the standard rebuilding tasks. Given such well-known alternatives as Java IDEs and Ant, readers could well ask why they should even think of using make on Java projects. Many Java developers like Integrated Development Environments (IDEs) such as Eclipse.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |