Of course, this is not the complete source code to the JVM, but the source code for the launcher. In your SDK installation directory ( C:\j2sdk1.4.2_04 on my machine), there is a file named src.zip. Unzip it and you will find several directories, including the launcher directory. Let's have a look at the files in the launcher subdirectory: I like to unzip it into a directory called src under my JDK home and point my Java IDE to it for debugging purposes. This is the shared launcher source code in C. It contains common code across platforms. This is the C header for the java.c file. It contains method signatures for the functions in java.c. This is the platform-specific launcher source code in C. This is the C header for the java_md.c file. It contains method signatures for the functions in java_md.c. The good news is that you do not have to edit any of this code to make your own custom launcher. Furthermore, it's probably a good idea not to. Sun may elect to change the launcher code at any time (and has in the past), so you would be forced to merge your changes and re-test. The default target is deploy, and will compile MyApp.java (an example Java program I included in the resourcesJuly2004.zipfile), jar it up, compile the launcher and copy both into the deploy directory.Ĭonfiguring the Preprocessor, C Compiler, and Linker with Ant I provided this script so that you can easily build your own launcher without spending hours trying to get the launcher to build. This is responsible for configuring the preprocessor, the C compiler, and the linker. The preprocessor variables passed in (prefixed with " -D") are as follows: The preprocessor and C compiler are configured with the CL environment variable, in which preprocessor variables are specified. This must be set for the launcher to compile properly. It is a boolean preprocessor variable, and should not have an explicit value. This causes the launcher to be like javaw. This means that it is a Windows program, not a console program.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |