如何更改JAVA.HOME为Eclipse / ANT [英] How to change JAVA.HOME for Eclipse/ANT

查看:529
本文介绍了如何更改JAVA.HOME为Eclipse / ANT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想签使用Ant脚本一个jar文件。我知道这已经在JDK目录jarsigner.exe运行必须指出,但是当我回声java.home返回JRE目录。

I am trying to sign a jar file using an ANT script. I know this has to be pointed at the JDK directory for jarsigner.exe to run, but when I echo java.home it returns the JRE directory.

这是不是javac的一个问题,因为我可以设置可执行文件的路径。但是,不存在对signjar。

This isn't a problem for javac, because I can set the executable path. But, that does not exist for signjar.

我要如何改变java.home路径?当我在我的电脑右键单击,然后去了,

How do I change the java.home path? When I right-click on MyComputer and go to,

属性>高级>环境变量

路径变量被正确地指出的JDK( C:\\ Program Files文件\\ java的\\ JDK \\ BIN )。

The "PATH" variable is correctly pointed to the JDK (C:\program files\java\jdk\bin).

更新:现在,该文件签署后更换正确PATH变量以下建议。

Update: The file now signs correctly after changing the PATH variable suggested below.

推荐答案

在Eclipse中的Ant的 java.home 的变量不是基于Windows JAVA_HOME环境变量。相反,它被设置为项目的JRE的主目录。

In Eclipse the Ant java.home variable is not based on the Windows JAVA_HOME environment variable. Instead it is set to the home directory of the project's JRE.

要更改默认的JRE(例如,将其更改为JDK),你可以去的视窗 - > preferences ... 的,选择的 Java的>安装的JRE

To change the default JRE (e.g. change it to a JDK) you can go to Windows->Preferences... and choose Java->Installed JREs.

要更改只是一个单一项目的JRE,你可以去的项目 - >属性的和选择的 Java构建路径的,选择的的标签。找到的 JRE系统库的,点击它,然后选择的修改的,并选择您想要的JRE(或JDK)。

To change just a single project's JRE you can go to Project->Properties and choose Java Build Path and choose the Libraries tab. Find the JRE System Library and click it, then choose Edit and choose the JRE (or JDK) that you want.

如果运行的版本文件,你可以选择时不工作,那么的运行AS-> Ant构建... 的,然后点击 JRE 的标签中,选择独立的JRE 的并指定你想在那里的JRE。

If that doesn't work then when running the build file you can choose Run as->Ant Build... and click the JRE tab, choose separate JRE and specify the JRE you want there.

这篇关于如何更改JAVA.HOME为Eclipse / ANT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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