如何在Mac OS X上安装JRE 1.7并将其与Eclipse一起使用? [英] How to install JRE 1.7 on Mac OS X and use it with Eclipse?

查看:248
本文介绍了如何在Mac OS X上安装JRE 1.7并将其与Eclipse一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用我从Oracle网站下载的JRE 1.7。

I want to use the JRE 1.7 that I downloaded from Oracle website.

所以我正确安装.pkg文件,当我尝试 / Library / Internet\ Plug-Ins / JavaAppletPlugin.plugin / Contents / Home / bin / java -version 在终端我得到这个:

So I correctly install the .pkg file, and when I try /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version in the terminal I get this :


java版本1.7.0_11Java )SE运行时环境(build
1.7.0_11-b21)Java HotSpot(TM)64位服务器虚拟机(构建23.6-b04,混合模式)

java version "1.7.0_11" Java(TM) SE Runtime Environment (build 1.7.0_11-b21) Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)

但在Eclipse中,我不能使用除JRE 1.6以外的任何东西。当我进入属性> Java构建路径>添加库> JRE系统库,我找不到1.7(只有它的选项: JavaSE-1.7(unbound)与此问题:

But in Eclipse I can't use anything else than JRE 1.6. When I go in Properties > Java Build Path > Add Library > JRE System Library, I can't find the 1.7 (there is only option for it : JavaSE-1.7 (unbound) with this issue :


工作空间中没有JRE与指定的执行环境兼容:JavaSE-1.7

No JREs in workspace compatible with specified execution environment: JavaSE-1.7

我该怎么办?谢谢

推荐答案

java.com 安装在 / Library / Internet Plug-Ins 中只是JRE,对于开发你可能想要下载JDK来自 http://www.oracle.com/technetwork/java/javase/ downloads / index.html ,然后再安装它,这将在 /Library/Java/JavaVirtualMachines/jdk1.7.0_<something>.jdk/Contents/Home 然后您可以通过首选项 - > Java - >安装的JRE添加到Eclipse。

The download from java.com which installs in /Library/Internet Plug-Ins is only the JRE, for development you probably want to download the JDK from http://www.oracle.com/technetwork/java/javase/downloads/index.html and install that instead. This will install the JDK at /Library/Java/JavaVirtualMachines/jdk1.7.0_<something>.jdk/Contents/Home which you can then add to Eclipse via Preferences -> Java -> Installed JREs.

这篇关于如何在Mac OS X上安装JRE 1.7并将其与Eclipse一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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