Following changes in JDK8 repository

我的梦境 提交于 2021-02-16 14:09:18

问题


I'd like to follow the development of JDK8, but what I see in the repo is strange at best:

6 days ago  katleman    Added tag jdk8-b60 for changeset e07f499b9dcc default tip   changeset | manifest
7 days ago  katleman    Merge jdk8-b60  changeset | manifest

Most changes look like "Added tag jdk8-b60 for changeset XXX" or "Merge XXX", there are a few entries looking like actual code changes, but no link to leads to code. Actually no single click brought me to anything marginally useful.

I know nothing about Mercurial, but should I? With any click on Github I get to somewhere...

So how can I follow what's going on in JDK8?


回答1:


As per Mercurial, tagging and merge changesets usually don't have any substantial code changes. Adding a tag changes the local .hgtags file in the repository and commits it immediately. Merges may have substantial code changes if code was actually changed during the merge, such as when the files being merged are in conflict. The merges that are currently near the tip of the repository (this one and this one) are both just merges taking place in the .hgtags file, actually, so have no code in them at all.

Anything that starts with "Added tag" is pretty much guaranteed to be just a change to .hgtags, and most merges won't have anything substantial either.

Now, the commits that do have substantial changes are the ones that start with numbers (such as this one). The numbers are directly related to issue numbers in the bug database. For example, that one that I just linked starts with "7197849", and it relates exactly to this bug report..

A couple of remarks: if you want to follow the progress more generally, you can take a look at the milestones defined for the project on this page. There are also some good starter tutorials, such as this one by Joel Spolsky, that can teach you some of the Mercurial basics, such as merging and what it means.

So...

All that being said, it looks like the repository you've actually linked to probably isn't the one you're looking for. There are actually several other repositories prefixed with jdk8 besides the one you linked. Here are some interesting places to look for repositories and code:

  • Top-level repository index - Lists all the repositories managed via Mercurial on the OpenJDK website. Just look for those that start with jdk8, among others such as lambda and nio.
  • hotspot - Actual JVM changes. These are changes being made to the native C/C++ code for the Hotspot JVM.
  • swing/jdk - Changes to .java files for Swing, both for shared code and for different platforms.

Of course, there are others, but exploring for yourself is half the fun (or battle, depending on how you may see it). Also take note that not all JDK8 stuff falls under a jdk8 repo. For example, the Lambda project repositories are prefixed with lambda.

One last thing: if you want to browse the repository itself, use the "manifest" link along the top nav bar. It will take you to a sort of explorer page. You can always just download the source as a zip too, if you like. It's all open source, so it's readily available for download.

Hope that helps. Happy hunting :)




回答2:


Perhaps this answer is overkill, but I hope that you at least find it useful.

I typically download the code and build it myself. There are tools to see what are the actual changes (like TortoiseHG). This is what I do:

How to Build the JDK 8

The following guide describes how to build the Open JDK 8 Developer Lambda Project using Ubuntu Linux 12.04 (Precise). If you need more details on how the build process works, please refers to the README for the New Build System. The process is pretty much the same for other JDK projects like the main JDK 8 forest or the Jigsaw forest.

How to Build the First Time

After you have installed Ubuntu, you must install the following additional packages:

sudo apt-get install build-essential
sudo apt-get install mercurial
sudo apt-get install tortoisehg
sudo apt-get install awk
sudo apt-get install m4
sudo apt-get install ccache
sudo apt-get install openjdk-7-jdk
sudo apt-get install ant
sudo apt-get install vim
sudo apt-get install libX11-dev 
sudo apt-get install libxext-dev 
sudo apt-get install libxrender-dev 
sudo apt-get install libxtst-dev
sudo apt-get install libcups2-dev
sudo apt-get install libfreetype6-dev
sudo apt-get install libasound2-dev

Download the Open JDK8 Lambda Project source code using Mercurial

hg clone http://hg.openjdk.java.net/lambda/lambda

Other project forests are:

http://hg.openjdk.java.net/jdk8/jdk8
http://hg.openjdk.java.net/jigsaw/jigsaw

Although Jigsaw has been deferred for JDK 9.

The previous command, actually, just downloads the root of the project forest. You still need to download the mercurial repositories for the rest of the subprojects (i.e. corba, jaxp, jaxw, langtools, jdk and hotspot). You do so by running the command get_source.sh which is located in the root folder of the project you just checked out.

cd ~/lambda
sh ./get_source

The download of all other project repositories might take a while, so be patient.

Once you have downloaded all the project repositories you are ready to configure the build. Assuming you are still located in the lambda directory

cd commom/makefiles
sh ../autoconf/configure 

This command: configure, has a lot of options that you can set to customize how the JDK will be built. You can see the documentation for those options by running configure --help. However, it should suffice with running the command without any parameters.

While you are still located at lambda/common/makefiles, now you are ready build the JDK 8.

make images

The make command also has multiple options to build the JDK. If you type make help you will see them all.

Depending on the amount of resources you have on your computer (cores and memory), this compilation process can take some time. I did it once in a Virtual Machine with a single core and 1GB of memory and it took all night. I do it now in a Intel Core i7 with 4 cores and 4 GB of memory and it takes less than 1 hour. At any rate, once the compilation is ready, the JDK image is located at:

~/lambda/build/linux-x64-normal-server-release/images/j2sdk-image

The directory linux-x64-normal-server-release could have a different name on your computer depending on its architecture.

You are good to go, you can now use this build to test JDK 8 new features.

How to Get Updates and Rebuild

As the work on the OpenJDK progress, you may want to get the latest source code now and then and rebuild the whole thing, right?.

To update to the latest source code simply run the command get_source.sh again:

cd lambda
sh ./get_source

You may not need to run the configure command again unless something has changed in your hardware architecture (i.e. more cores, more memory) or your installed software (i.e. installed jdk). However, if you want to be sure, and run it all over again, start by cleaning and totally wiping out the previous build:

make dist-clean

This command will deleted the previous configurations and build.

Then you can configure again:

cd commom/makefiles
sh ../autoconf/configure

And finally, build the system again:

make images

How to Know What Changed

Evidently, once you obtain the latest version of the code, you may want to know what has changed since you last build. Things may have changed in any of the subprojects (i.e. hotspot, langtools, etc). However, the JDK API is being actively developed in the JDK subproject.

Since the projects use Mercurial, you can use TortoiseHG to interact with your repository and see what has changed. Simply locate over one of the project directories and run the TortoiseHG command:

cd ~/lambda/jdk
thg

This will launch the TortoiseHG GUI Tool in which you can easily see the log for all changes in the repository and what was exactly modified in the last update you got, in the example above for the jdk subproject. You can see what changes the compiler suffered in the langtools subproject, and see what changes the jvm suffer in the hotspot subproject by invoking the thg command in every one of these subfolders.

How to Create Java Documentation

Although the configure command comes with an option called --enable-docs which is supposed to automatically generated Java documentation during the build, it appears that, as of today, this flag is not doing anything. Therefore, you can generate the javadocs using the following command:

~/lambda/build/linux-x64-normal-server-release/images/j2sdk-image/bin/javadoc \
-d ~/lambda/build/linux-x64-normal-server-release/images/j2sdk-image/docs \
-use \
-author \
-version \
-linksource \
-splitIndex \
-windowtitle 'Java 2 Platform 8.0 API Specification' \
-doctitle 'Java<sup><font size="-2">TM</font></sup> 2 Platform 8.0 API Specification' \
-header '<b>Java 2 Platform </b><br><font size="-1">8.0</font>' \
-group "Core Packages" "java.\*" \
-overview ~/lambda/jdk/src/share/classes/overview-bundled.html \
-sourcepath ~/lambda/jdk/src/share/classes \
java.lang java.util java.util.functions java.util.concurrent \
java.lang.annotation java.lang.reflect java.lang.ref

Notice that the source code for the JDK is located in ~/lambda/jdk/src/share/classes/

The list packages specified here are the ones where most of the JDK 8 work is being carried out. Add any other packages that you consider necessary.




回答3:


The repo you're looking at is the "root" or "top" repo of the JDK8 source tree. It contains mostly makefiles and other configuration files, so that's why there's not much of interest in the changeset history. There are nested repositories that contain the interesting source code. For example, the Hotspot JVM is in hotspot, the class libraries are in jdk, and the javac compiler and other tools are in langtools.

This arrangement is described in great detail in the OpenJDK Developer's Guide.



来源:https://stackoverflow.com/questions/12947742/following-changes-in-jdk8-repository

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!