简体   繁体   English

JDK8u40 的 src.zip 在哪里?

[英]Where is the src.zip for JDK8u40?

I installed the JDK8u40, but only find the javafx-src.zip.我安装了JDK8u40,但是只找到了javafx-src.zip。

Where can I find the source code for JDK?我在哪里可以找到 JDK 的源代码? The src.zip? src.zip?

Below is what I get after installation:下面是我安装后得到的:

And btw, I didn't see the installation wizard!顺便说一句,我没有看到安装向导! This is quite strange.这很奇怪。

在此处输入图片说明

ADD 1添加 1

Today I tried several Java installation packages.今天试了几个Java安装包。 All are downloaded from Oracle official site.都是从Oracle官网下载的。

  • jdk-6u45-windows-i586.exe jdk-6u45-windows-i586.exe
  • jdk-7u75-windows-i586.exe jdk-7u75-windows-i586.exe
  • jdk-8u20-windows-i586.exe jdk-8u20-windows-i586.exe
  • jdk-8u25-windows-i586.exe jdk-8u25-windows-i586.exe
  • jdk-8u31-windows-i586.exe jdk-8u31-windows-i586.exe
  • jdk-8u40-windows-i586.exe jdk-8u40-windows-i586.exe

Both 6u45 and 7u75 installed well on my box. 6u457u756u45 7u75安装在我的盒子上。 I can see the install wizard.我可以看到安装向导。 And the src.zip is installed.并安装了src.zip

But 8u25 ~ 8u40 all installed silently.但是8u25 ~ 8u40都是静默安装的。 And no src.zip file is installed because I have no chance to select it in the wizard.并且没有安装 src.zip 文件,因为我没有机会在向导中选择它。

I am not sure if this is my fault or someone at Oracle made a mistake.我不确定这是我的错还是 Oracle 的某个人犯了错误。

As @SubOptimal commented, the /s option indicates a silent install.正如@SubOptimal 所评论的, /s选项表示静默安装。 I am wondering if there's an option to force the GUI install wizard to open.我想知道是否有一个选项可以强制打开 GUI 安装向导。

I am using Windows 7 Enterprise x64 Build 7601 SP1我使用的是Windows 7 Enterprise x64 Build 7601 SP1

Make sure the Source code is not disabled when downloading.确保下载时未禁用Source code

在此处输入图片说明

Then as you can see on the picture, selecting "Source Code" will tell you exactly where it is located.然后就像你在图片上看到的那样,选择“源代码”会告诉你它的确切位置。

在此处输入图片说明

Notice that I've downloaded the 32 bits version to make sure to reproduce the same use case as you.请注意,我已经下载了 32 位版本,以确保重现与您相同的用例。


Edit编辑

As per your new edits and comments, it seems what you want to know now is why you don't see the installation wizards.根据您的新编辑和评论,您现在想知道的是为什么看不到安装向导。 I'm pretty sure this is due to old-set registry key.我很确定这是由于旧设置的注册表项造成的。

Run the following command运行以下命令

reg query hklm\software\microsoft\windows\currentversion\installer\UserData\S-1-5-18\Products /f "java" /s | find "HKEY_LOCAL_MACHINE"

Now, navigate to each of the returned path browsing with regedit and delete their entire parent (the big hexa number).现在,使用regedit导航到每个返回的路径浏览并删除它们的整个父级(大六进制数)。

Re-try the installation and I'm pretty sure you will see the wizard.重新尝试安装,我很确定您会看到向导。


As for the sources, Oracle documentation specify how to download them in silent mode.至于来源, Oracle 文档指定了如何以静默模式下载它们。

jdk.exe /s ADDLOCAL="SourceFeature"

This is the way I got the src folder from jdk-8u172-windows-x64.exe file without installing.这是我从 jdk-8u172-windows-x64.exe 文件中获取 src 文件夹而不安装的方式。

Step1: Download jdk-8u172-windows-x64.exe file (Java SE Development Kit 8u172) from oracle site Step1:从oracle站点下载jdk-8u172-windows-x64.exe文件(Java SE Development Kit 8u172)

Step2: Extract it and navigate to the path: \\jdk-8u172-windows-x64.rsrc\\1033\\JAVA_CAB9 Step2:解压并导航到路径:\\jdk-8u172-windows-x64.rsrc\\1033\\JAVA_CAB9

Step3: Right click on file named "110" and extract it.步骤3:右键单击名为“110”的文件并将其解压缩。

You will get the src.zip file.您将获得 src.zip 文件。

It took me little while to figure this out.我花了一点时间才弄明白这一点。 I hope it will help others.我希望它能帮助别人。

Enjoy debugging Good Code!享受调试好的代码!

I don't know why/where the src.zip is, but as an alternative , if all you want is the source and somehow the proposed method doesn't work for you, you could always pull directly from the JDK8u40 source tree.我不知道 src.zip 的原因/位置,但作为替代,如果您想要的只是源代码,并且以某种方式建议的方法对您不起作用,您始终可以直接从 JDK8u40 源代码树中提取。

You will need Mercurial instead of Git.您将需要Mercurial而不是 Git。 This link talks about the hg clone command此链接讨论 hg clone 命令

Quoting from the OpenJDK Java.net site引自OpenJDK Java.net 站点

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 .可以使用以下命令克隆相应的主森林 jdk8u: hg clone http://hg.openjdk.java.net/jdk8u/jdk8u;cd jdk8u;sh get_source.sh 。

In addition, the source code for the last release, 8u40, is available by cloning the 8u40 master forest : http://hg.openjdk.java.net/jdk8u/jdk8u40 .此外,最新版本 8u40 的源代码可通过克隆 8u40 主森林获得: http ://hg.openjdk.java.net/jdk8u/jdk8u40。 The final build of that release was tagged as jdk8u40-b25.该版本的最终版本被标记为 jdk8u40-b25。

There are differences between OpenJDK and Oracle's, though subtle OpenJDK 和 Oracle 之间存在细微的差异

download JDK 8 from following link从以下链接下载 JDK 8

http://www.oracle.com/technetwork/java/javase/jdk-8-readme-2095712.html http://www.oracle.com/technetwork/java/javase/jdk-8-readme-2095712.html

src.zip comes in-built with it src.zip 是内置的

if you JDK installer silently skips installing the source.如果 JDK 安装程序静默跳过安装源代码。 just open the control panel > programs an features and find Java.只需打开控制面板> 编程功能并找到Java。 Right click on it and select change and then select the source (option) ;)右键单击它并选择更改,然后选择源(选项);)

在此处输入图片说明

  1. Download the JDK下载 JDK
  2. Run the Installer, but stop right away运行安装程序,但立即停止
  3. Extract src.zip from C:\\Users\\<your_username>\\AppData\\LocalLow\\Oracle\\ss180121.cab提取src.zipC:\\Users\\<your_username>\\AppData\\LocalLow\\Oracle\\ss180121.cab

You can extract .zip from .cab with tool like 7Zip您可以使用 7Zip 等工具从.cab提取.zip

Taken from取自

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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