Deeper Java2 SDK Source Code (1)

zhaozj2021-02-08  308

Deeper Java2 SDK Source Code (1)

Java2 SDK source code overview

Author: Wang Sen (National Institute of Science and Technology)

So far, only Java2 SDK 1.3 Win32 is released on Sun Microsystems website.

The source code of the Java2 SDK Solaris / Linux version is only 1.2.2.

. Therefore, this article applies only to Win32 version of the Java2 SDK 1.3. All operations

All are tested on the Windows 2000 PROFESSIONAL operation system. If you are in different

Verify this article on the platform, or use the Solaris version released in the future, the LINUX version of the original

Start code. We cannot guarantee that there will be the same results.

█ introduction

It is said that the evolution of information society has a lifecycle, only one from the earlier desk of everyone.

The era of the terminal is slowly advanced to the PC era, then we found that gradually trend and go back to NC (N

Etherk computer, manufacturers advocate the THIN Client's era. View on the source code

So, from the early vendors, there is a program source code in the machine for sale.

The gradually ground code becomes the asset that the manufacturer is unique and unwilling to open, and finally evolved into everyone.

The era of Open Source, Free Software. No matter whether the Poemns is really interested

Go to Trace to attach the source code in your computer, but I think this is the most valuable to open the original law.

Place - Everyone has the opportunity to peek the internal behavior of the system, the security of your computer and

The process of operation will never control in the hand of a particular manufacturer, with the source code, we are also

Don't have to doubt whether a vendor's job system or application is sneaked behind your capital.

Retrieve in the servo of their company.

With the trend of this open source, Java2 SDK source code is actually released.

For a long time, the license used for Sun Community Source Code LIC

Ense (SCSL), with general Publi, which will usually discuss when Open Source

C license (GPL) is different. I believe that everyone will find that in the relevant article

And use Java SDK to remove the issues released by General Public License. October Sun in October

After the STAR Office's source code is released by General Public License, the next larger

The home is looking forward to the SUN to release the source code of Java SDK in general public license.

If this is true, then the future development of Java will not be what we can predict, if

Success, Java will spread the wings like Linux, and if there is no success, then it will like M

Ozilla plans to be small in the rain.

First, no matter which license compares Open, which compare free, the author writes this series

The purpose of the chapter is that only one is to excavate the operation mechanism existing in Java2 SDK. due to

For a while, the author's education work has taken time, the more students have, the more you look deep.

The awareness of Java is still limited, and we often use the implementation files (EXE, such as JavaC.exe, J

Ava.exe et al., several important dynamic links (DLLs, such as JVM.DLL, Java.dll

Wait, and other kits written in the Java program (Package, such as Java.io,

Java.util et al., these are the topics I want to understand carefully, so they have the birth of this series.

Of course, the program of TRACE is in this case, it is a bit like a pro-formal black hand.

Things, but the author deeply felt that Taiwan's software industry should still take a long time to stand on the international stage. From a big point of view, system analysis, system design, system test, how to properly

Allocate limited human resources, at least we have no way to mention which domestic companies will

Good work is very good, from the source code of Java2 SDK, we can see development

The microstructure structure used in the SDK (Software Development Kit), original

How to put the location of the code? So how to consolidate the program written by the multi-trans-designer

Effect? ​​How to automate the file? I think we must be from Java2 SDK source code

Get some answers. From a small point of view, how to make good use of Design Pattern? How to write effective

The rate of the program? How to make the program code written out of the program? We all know

Java's internal suite uses Design Pattern, we also know that Java is virtual

The relationship of the machine, so the program code must be very efficient, I believe these problems can also be from Java

2 SDK source code gets the answer.

Vigorously promoting the development of Open Source is also very clear, open source will be development

The Chinese caught up with the national software industry. Looking forward to personal efforts can be this

A large revolution is an indispensable lack of screws.

In the first one of this series, the author will introduce the viewer of the Java2 SDK source code.

It has the ability to get Java2 SDK source code and can successfully compile these source code. Not nonsense

Say, let's get started!

■ How to get Java2 SDK source code

To get the source code of Java2 SDK, first you have to be Java Developer Connecti

One member of On (JDC), so please come first

http://developer.java.sun.com/develop

Register on the ER / website to get the user ID and password. When you succeed as Java Developer Co

After a member of the Nnection (JDC), please go

http://www.sun.com/software/commu

NITYSOURCE / JAVA2 /, you will see the option to download the Java2 SDK source code, click in

After that, enter your user ID and password in Java Developer Connection (JDC).

After you accept License, you can start downloading the source code of Java2 SDK.

█JAVA2 SDK Source Code Architecture

When you solve the compressive file of the Java2 SDK source code, you will see the directory shown below.

Structure:

◇ Build directory

Place all Makefile files, these makefiles are NMAKE attached to Visual Studio

The format that can be interpreted by .exe. Usually the name of Makefile has five, named Makefile, *.

NMK, *. JMK (specified .java file), *. cmk (specified .c file to be compiled), *. mk

. You can find some .java files under build / share.

Since we want to compile the Java SDK under the Windows operating system, makefile

The main unit is build / win32 / makefile, the compile process of the entire Java2 SDK is rooted in this

Sample, under the Build / Win32 / makefiles directory you can find a shared Makefile

Usually the name is .nmk.

Makefile under the build / win32 directory is used to build and Windows job systems

Program. And there are more .mk, .jmk, .cmk files, these files under the build / share directory.

Usually used to build and Windows job systems unrelated programs.

◇ EXT directory

At the end of this directory, the Makefile and source code used to support the Java2 SDK library, which are written in the Java program.

In the EXT / I18N directory, there is a library related to Internationalization.

These compiled files were finally put in I18n.jar.

The EXT / JPDA directory is placed with the Java Platform Removal Arranging Architecture (Java Platform Debugge)

R Architecture) Related files.

◇ SRC directory

This directory is placed all .c file (written in C programming) for all the construction of Java SDK

Write) and .java file (written in Java program).

SRC / Win32 directory is used to build a source code related to the Windows job system. In

At the bottom of the src / share, it is mostly the source code independent of the Windows job system. So smart

Readers should be able to guess the source code of most Java standard suite in SRC / Share

Under record. The source code of these standard kits is finally added to Src.jar, compiling

Over. Class files are dispersed in many different JAR files.

◇ LegalReadme.html

Sun Community Source Code License Copyright

◇ Originalcode.txt

A list of all files in the Java2 SDK source code.

◇ Readme.html

About Java2 SDK source code, most of which have been integrated by the author

In this article.

From the architecture of the Java2 SDK source code, we can find that its files are unique.

It is the practice of subsequent placement with Makefile and source code, which is different from us, such as L

Inux Kernel Source Code) Make the Makefile and the source code. These two practices

Advantageous and disadvantage. After the Linux Kernel source code, you will see the original after each compilation is completed.

The intermediate archive generated during the start code file and the compilation process are mixed together, and it feels a bit confusing. If I

We use the Directory structure of Java2 SDK source code, each time the intermediate file and source code

It will be separated in different directories, it looks very pleasing, but the cost of this place is

It is made of Makefile for the path to the path, you will be in the original SDK in Java2 SDK.

The Makefile in the code found a lot of narratives ../../../src's narrative, it seems uncomfortable, such as

If we have to understand which files are made up of this executive.

■ How to compile Java2 SDK source code

When we understand the Java2 SDK source code, many engineers must try their own try to repair

I'm trying to compile, I think this is the biggest pleasure of an engineer. of course,

Before we have not modified, we must also try to compile the entire source code.

Whether the source code is complete, so the next preparation step and method for compiling Java 2 source code

.

To successfully compile the Java2 SDK source code, you must meet several conditions:

(1) Operation system

You must build Java 2 original in Windows NT 4.0 or Windows 2000

code. Once the compilation is completed, the generated execution file or dynamic link and the library will be able to

Some Win32 work platforms are executed.

(2) hardware equipment

In the files attached to the Java2 SDK source code, the recommended hardware device is Pentium level.

The processor is equipped with a memory of at least 128 MB. Pentium III 450 on the computer

With the Memory of PC 100 128 MB, it takes nearly 2.5 hours to complete all compilation.

Work. If you count some errors encountered during the compile time, it takes 3

Hours.

(3) Development Tools

We must prepare a few tools, they are:

- Microsoft Visual C Version 6.0, with the latest Service Pack (or Visual Studio 97 with Service Pack 3).

In the Java2 SDK source code, there are many programs related to the Windows platform, this

Some types of code are written in C language, and we must compile these original code to successfully

To create a Visual C compiler to generate an execution file that can be performed on a Windows platform (.exe

) And dynamic links and libraries (.dll).

At the same time, there are many makefiles in the Java2 SDK source code, which is used to control

All program compilation action. We must use NMAKE.EXE attached to Visual C .

Tools help us interpret these Makefile and compile the entire Java2 SDK.

- MKS Toolkit Version 5.2 above.

MKS Toolkit is a set of tools that can simulate the Unix execution environment on Windows, please go to HT

TP: //www.mks.com Download the 30-day trial version of this tool (official version must be paid). or

If you have the version above you have subscribed to MDSN Professional, you can find Microso in the disc.

FT Windows Services for UNIX 2.0 Add-on Pack (in Unix20_inserv / 3RD

Under the Party / MKS directory, you can install the setup.exe in the x86 subdirectory). 30-day trial

The functional knight and paid version of the paid version are just when you compile Java2 SDK.

At the time of the code, just use the tool in MKS Toolkit, there will be an advertisement screen.

It should not affect your mood.

- The executable version of Java2 SDK 1.3.

I believe that the readers will see this place, they will feel very confused. Strange, compile Java2 SDK

The source code actually needs Java2 SDK assistance? Can't help but think of the question of chicken egg egg

Question, isn't it? In fact, Java2 SDK plays Bootstrap COM throughout the compilation process.

The role of the Piler (Bootboard Compiler). The reason why the Java2 SDK is required is because everyone is

The Javac.exe core program used when compiling the Java program is also written in Java.

Since the source code of Java2 SDK is not related to the platform, written in Java program language

Program, so in the initial compilation, we must use the old version of Java2 SDK or JDK help

We produce a new version of Java2 SDK, and then compile Java2 SD with the new new version of JavaC.exe.

The other .java file in the K source code.

(Continued next time)

转载请注明原文地址:https://www.9cbs.com/read-230.html

New Post(0)