bin的java.exe和JRE的'java.exe'之间的区别 [英] Difference between bin's java.exe and JRE's 'java.exe'

查看:53
本文介绍了bin的java.exe和JRE的'java.exe'之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Java的新手.我很困惑哪个解释器用于执行Java程序,因为我看到两个 java.exe ,一个在 bin 文件夹中,另一个在JRE的 bin 文件夹.

I am new to Java. I have a confusion which interpreter is used to execute Java programs as I can see two java.exe, one inside the bin folder and the other inside JRE's bin folder.

我想添加一些详细信息以清除查询:

I want to add some details to clear my query:

假设Java安装在 C:\ Program Files \ Java \ Jdk1.6 中.现在,在该目录中,有一个 jre 文件夹,一个 bin 文件夹以及其他文件夹,但让我们集中讨论这两个文件夹.该 .. \ jre \ bin 文件夹包含 java.exe ,而 .. \ bin 文件夹也包含 java.exe .因此,我的担心是:哪个Java解释器用于执行Java程序?

Suppose Java is installed in C:\Program Files\Java\Jdk1.6. Now, in this directory there is the jre folder, bin folder, and other folders as well, but let’s concentrate on these two. This ..\jre\bin folder contains java.exe and the ..\bin folder also contains java.exe. So, my concern is: Which Java interpreter is used to execute Java programs?

推荐答案

摘自Java SE安装说明:

From the Java SE installation notes:

http://www.oracle.com/technetwork/java/javase/documentation/install-windows-142126.html#private

安装JDK会安装一个私有Java SE运行时环境(JRE)和一个公共副本(可选).要运行JDK随附的工具,需要私有JRE .它没有注册表设置,并且完全包含在jre目录中(通常位于 C:\ Program Files \ jdk1.6.0 \ jre 中),该位置仅JDK知道.另一方面,公共JRE 可以由其他Java应用程序使用,包含在JDK外部(通常位于 C:\ Program Files \ Java \ jre1.6.0 ),已在Windows注册表中注册(位于HKEY_LOCAL_MACHINE \ SOFTWARE \ JavaSoft),可使用添加/删除程序"删除,可能已或可能未在浏览器中注册,并且可能已将java.exe复制到Windows系统目录(使其成为默认的系统Java平台).

Installing the JDK installs a private Java SE Runtime Environment (JRE) and optionally a public copy. The private JRE is required to run the tools included with the JDK. It has no registry settings and is contained entirely in a jre directory (typically at C:\Program Files\jdk1.6.0\jre) whose location is known only to the JDK. On the other hand, the public JRE can be used by other Java applications, is contained outside the JDK (typically at C:\Program Files\Java\jre1.6.0), is registered with the Windows registry (at HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft), can be removed using Add/Remove Programs, might or might not be registered with browsers, and might or might not have java.exe copied to the Windows system directory (making it the default system Java platform or not).

因此,我认为您在执行Java程序时应使用/bin目录中的可执行文件.

So I think you should use executables from the /bin directory when executing Java programs.

这篇关于bin的java.exe和JRE的'java.exe'之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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