如何查看 eclipse IDE 正在使用的当前环境变量?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6899461/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 16:45:24  来源:igfitidea点击:

How can I look at the current environmental variables that eclipse IDE is using?

javaeclipseenvironment-variables

提问by Grammin

I know that I can just run a program with

我知道我可以运行一个程序

System.out.println(System.getEnv()); 

but I would like to just check them without having to do that. Any Ideas?

但我只想检查它们而不必这样做。有任何想法吗?

回答by An Chin

There is actually a way to see the env vars. It is not implemented as a function, but part of other tasks.

实际上有一种方法可以查看环境变量。它不是作为一个函数来实现的,而是其他任务的一部分。

You can right click on any projects in Package Explorer, then click

您可以右键单击Package Explorer 中的任何项目,然后单击

Run As-> Run Configurations. And here, in tab Environment-> Select...

运行方式->运行配置。在这里,在选项卡Environment-> Select...

Here you go. The list of system env Eclipse inherited are shown here.

干得好。此处显示了系统环境 Eclipse 继承的列表。

回答by jkeeler

Eclipse's environment will inherit from the user executing it. Depending on your OS, you should have a command line tool to tell you.

Eclipse 的环境将从执行它的用户那里继承。根据您的操作系统,您应该有一个命令行工具来告诉您。

You can also look at the configuration:

也可以看一下配置:

Helios

赫利俄斯

  • Helpmenu -> About Eclipse
  • Installation Detailsbutton
  • Configurationtab
  • 帮助菜单 ->关于 Eclipse
  • 安装详细信息按钮
  • 配置选项卡

回答by nikc

On Windows, if you have Sysinternals Process Explorer installed - which I would strongly suggest any developer do - then you can:

在 Windows 上,如果您安装了 Sysinternals Process Explorer(我强烈建议任何开发人员这样做),那么您可以:

  1. Use the target icon (at the top of Process Explorer) and click on the Eclipse window which will select the Eclipse Process ID in the Process table
  2. Right-click on the selected Eclipse entry and select Properties... from the context menu
  3. Click on Environment
  1. 使用目标图标(在 Process Explorer 顶部)并单击 Eclipse 窗口,这将在 Process 表中选择 Eclipse Process ID
  2. 右键单击选定的 Eclipse 条目并从上下文菜单中选择 Properties...
  3. 点击环境

On Linux

在 Linux 上

  1. If you need the PID, then use the following and click on the Eclipse window: xprop | grep -i pid
  2. Replace ${PID}with the PID of the Eclipse Process ID: strings /proc/${PID}/environ
  1. 如果您需要 PID,请使用以下命令并单击 Eclipse 窗口: xprop | grep -i pid
  2. 替换${PID}为 Eclipse 进程 ID 的 PID:strings /proc/${PID}/environ