简体   繁体   中英

How to download the most updated java virtual machine(Hotspot) source code?

I am going to contribute to Java Community and I am interested in JVM.

Now I would like to download the most updated JVM Hotspot source code and track the updates.

First, I go to http://openjdk.java.net/ .

On its left side I find some useful tag

Source code: 
Mercurial 
Bundles
...
JDK 6
JDK 7
JDK 7 Updates
JDK 8 · Java SE 8
JDK 8 Updates
JDK 9 · Java SE 9
JDK 10

I can only find instruction about how to download source code of JDK8u: http://openjdk.java.net/projects/jdk8u/

Status

We're open for fixes for 8u152 in the jdk8u-dev forest. (The post time is 2017-06-06 14:23:36 )

Source code

The jdk8u-dev forest for ongoing development can be cloned using this command: hg clone http://hg.openjdk.java.net/jdk8u/jdk8u-dev;cd jdk8u-dev;sh get_source.sh .

The corresponding master forest jdk8u can be cloned using this command: hg clone http://hg.openjdk.java.net/jdk8u/jdk8u;cd jdk8u;sh get_source.sh .

In addition, the source code for the last release, 8u102, is available by cloning the 8u master forest : http://hg.openjdk.java.net/jdk8u/jdk8u and using the ' jdk8u102-b14 ' mercurial tag.


But it appears that jdk9 and jdk10 are also on the list. Are they the most updated source code and how can I download them?

JDK9 page does not provide instructions about how to get source code. JDK9 : http://hg.openjdk.java.net/jdk9

JDK10: http://openjdk.java.net/projects/jdk10/


Besides, if the Java Community release a new update, what is the best way to update my current source code? Download again or use Mercurial tool?


What is forest in jdk source code? Is it similar to branch in git?


Also, I can find another way to download JVM Hotspot source code from github in JetBrains:

https://github.com/JetBrains/jdk8u_hotspot/tree/d37547149a7c5647ebffbbb62525cc62bd8e2673

But I am not sure this one is the most updated one.

This depends on what you mean by 'most updated' .

Actually, all of jdk8u , jdk9 and jdk10 repositories are kept up-to-date; they are just separate projects having different status and accepting different set of changes.

  • jdk8u has the most recent changes that will appear in the future updates of JDK 8. These updates mainly consist of bug fixes.
  • jdk9 repository contains up-to-date code that will be released soon as JDK 9. The project is now in Rampdown phase 2 meaning that only showstopper bugs can be fixed there. It's not defined yet what will happen to this repository after JDK 9 release - eg give start for something like jdk9u.
  • jdk10 contains the ongoing work on future version of Java SE platform. Important improvements made here are likely to be backported to jdk9 sometime later (of course, if they comply with the specifications).

    Note that new features are not developed directly in this repository. New features must go through JEP process . Some bigger features may be even hosted in separate projects like Panama or Valhalla .

The official repositories of OpenJDK projects are hosted at http://hg.openjdk.java.net
To get the sources use Mercurial, eg

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

It contains several nested repositories. HotSpot JVM is under hotspot :

hg clone http://hg.openjdk.java.net/jdk10/jdk10/hotspot

Later you can use hg pull -u to sync your local repository with the updates from the master.

In the parent repository you'll also find the instructions how to get the sources and to build OpenJDK: common/doc/building.md . There is a similar document in jdk9 repo.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM