简体   繁体   English

如何在NetBeans中为Java项目定义环境变量?

[英]How can I define environment variables for a Java project in NetBeans?

I need to define environment variables for my project since I will eventually want to deploy it to Heroku, or any other PaaS. 我需要为我的项目定义环境变量,因为我最终希望将它部署到Heroku或任何其他PaaS。 What I am having trouble with is run the application from the NetBeans IDE with my environment variables. 我遇到的问题是使用我的环境变量从NetBeans IDE运行应用程序。

Where can I enter them so I can test them? 我在哪里可以输入它们以便我可以测试它们? I use environment variables for MongoDB URI, different API keys, etc. 我使用MongoDB URI的环境变量,不同的API密钥等。

Edit: I am using OSX 10.10.2 with NetBeans 7.4. 编辑:我正在使用OSX 10.10.2与NetBeans 7.4。

I tried looking at this discussion but my version of NetBeans lacks the Set Properties: Add in the Run dialog. 我尝试查看讨论,但我的NetBeans版本缺少“设置属性:添加在运行”对话框中。

You should look in the Actions dialog, not in Run. 您应该查看“操作”对话框,而不是“运行”。 There you select 'Run project' and then click the Add button. 在那里选择“运行项目”,然后单击“添加”按钮。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM