自动将Java 8源代码与Eclipse IDE链接 [英] Automatically linking Java 8 source code with Eclipse IDE

查看:62
本文介绍了自动将Java 8源代码与Eclipse IDE链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Eclipse IDE(Mars 4.5)安装中,它没有自动将rt.jar和jfxrt.jar链接到src.zip和javafx-src.zip.我知道如何通过浏览JDK安装中的.zip文件来手动执行此操作.

In my installation of Eclipse IDE (Mars 4.5) it has not automatically linked rt.jar and jfxrt.jar to src.zip and javafx-src.zip. I know how to do this manually by browsing to the .zip files within the JDK installation.

我想知道的是,是否有一种方法可以确保在安装Eclipse/Java时自动发生这种情况.我敢肯定,我知道有人没有手动链接到源,并且在安装时已链接.

What I want to know is if there is a way to ensure this happens automatically when installing Eclipse / Java. I'm pretty certain I know someone who didn't link to the source manually and it is linked on their installation.

例如,如果您在Eclipse之前安装JDK,反之亦然,这有什么区别吗?

For example, if you install the JDK before Eclipse, or vice-versa, does this make any difference?

此外,当您进行链接时,首选项信息在文件系统中存储的位置是abouts-它是否在eclipse.exe存在的同一文件夹中的某个位置?

Also, when you make the link, where abouts is the preference information stored on the file system - is it somewhere within the same folder that eclipse.exe exists?

推荐答案

要确保Eclipse在JDK中而不是JRE中运行(JDK安装通常将JRE放在系统可执行文件路径上),应始终指定通过 eclipse.ini 进行操作.此处描述的-vm选项可以告诉Eclipse您希望它在哪个JVM中运行.

To make sure that Eclipse is running in your JDK instead of a JRE (The JDK installation typically puts a JRE on the system executable path), you should always specify it via eclipse.ini. The -vm option described there tells Eclipse exactly what JVM you want it to run in.

另一个选择是将JDK添加到Eclipse首选项的 Installed JREs 部分中,并将其设置为所有项目的默认设置.用于项目的默认JVM与运行Eclipse的默认JVM相同,因此您不必同时执行这两个操作.

Another option is to add the JDK to the Installed JREs section of your Eclipse preferences and set that as the default for all projects. The default JVM used for projects is the same as the one Eclipse itself runs in, so you don't necessarily need to do both.

将JDK设置为默认JVM之后,您可以打开项目的属性",选择" Java构建路径"部分,然后查看""选项卡.您应该将您的JDK视为 JRE系统库,包括其rt.jar和相应的源附件.像这样:

Once you have the JDK set as the default JVM, you can open a project's Properties, select Java Build Path section, then look at the Libraries tab. You should see your JDK as the JRE System Library, including its rt.jar and corresponding source attachment. Like this:

这篇关于自动将Java 8源代码与Eclipse IDE链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆