37

Can anyone direct me to where the jdk 7 source is hosted?

durron597
  • 31,968
  • 17
  • 99
  • 158
instantsetsuna
  • 9,183
  • 8
  • 25
  • 28
  • 2
    http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/util/concurrent/ExecutorCompletionService.java#ExecutorCompletionService.QueueingFuture – Mickey Tin Dec 20 '14 at 14:09

8 Answers8

17

The direct link is this.

If you wonder how this link is got, follow this link, except that select "jdk7/jdk7-gate/jdk" instead of "jdk6/jdk6-gate/jdk" for jdk 7 sources.

Community
  • 1
  • 1
fouding.zheng
  • 281
  • 2
  • 5
15

For Java source codes in JRE, this website is more useful than hgweb for OpenJDK7.

nodakai
  • 7,773
  • 3
  • 30
  • 60
11

This is the repository for OpenJDK

As for Oracle's JDK7, there are binaries and docs, but no source to browse.

Raghuram
  • 51,854
  • 11
  • 110
  • 122
  • 2
    Not actually browsable (any more?). – Raedwald Mar 28 '13 at 11:08
  • 1
    I installed Oracle's JDK 7 just last week and src.zip is still available, it's a part of the main SDK download. For me it is under `/usr/java/jdk1.7.0_80/src.zip` – robert Aug 07 '18 at 16:25
6

I find http://www.codatlas.com to be a very handy place to read java code. For example you will find open JDK7 source code here:

http://codatlas.com/github.com/lambdalab-mirror/jdk7u-jdk/master/

It's biggest advantage is that besides syntax highlighting as @Jakub mentioned in his answer, it also supports cross reference, which will makes the code browsing experience 10x easier.

It has bunch of other JVM based projects too (Apache Hadoop, ElasticSearch etc.). It also supports scripting language like ruby and python but the performance is not great at this moment.

hexabunny
  • 1,405
  • 1
  • 11
  • 12
4

You can find the source files here jdk7source

I was looking for it when I found this question and that is why I decided to add this answer, as none of the other answers have it, but there is no web interface for browsing.

oarsome
  • 267
  • 2
  • 8
3

There is JDK7 source code mirror on GitHub. Easier to browse, and with syntax highlighting.

Jakub M.
  • 32,471
  • 48
  • 110
  • 179
1

I don't think that the source of the Sun JDK is openly available. Why not try the OpenJDK Mercurial repos

Hope that helps.

Rich
  • 216
  • 2
  • 6
0

If you want to browse the source locally. Then you can find the source in the jvm directory in the src.zip file. for linux environments the file is located in /usr/lib/jvm/java-7-oracle

Jurrian Fahner
  • 349
  • 1
  • 11