简体   繁体   English

如何为 Apache ActiveMQ Artemis 配置专用 JDK?

[英]How to configure a dedicated JDK for Apache ActiveMQ Artemis?

I need to install an MQ server (Apache ActiveMQ Artemis 2.27.x) on Linux for our team.我需要在 Linux 上为我们的团队安装 MQ 服务器 (Apache ActiveMQ Artemis 2.27.x)。 I just read some documentation and articles.我刚刚阅读了一些文档和文章。

Since our Linux server is messy, there may be many JDKs, and the environment variables are not reliable, so I want to specify the JDK path for Artemis (like, put JDK in the Artemis directory), but I haven't searched for a satisfactory solution.由于我们的Linux服务器比较乱,可能JDK很多,环境变量也不靠谱,所以想给Artemis指定JDK路径(比如,把JDK放在Artemis目录下),但是一直没有搜索到满意的解决方案。

I first did a test installation on my Windows machine.我首先在我的 Windows 机器上进行了测试安装。 I tried modifying artemis.cmd (setting the JAVA_HOME environment variable) and it worked, but I don't think it's a good idea as doing so could be potentially dangerous.我尝试修改artemis.cmd (设置JAVA_HOME环境变量)并且成功了,但我认为这不是一个好主意,因为这样做可能存在潜在危险。

Is there an elegant way to configure JDK for Artemis?有没有一种优雅的方式来为 Artemis 配置 JDK? Like modifying some Artemis configuration files.比如修改一些 Artemis 配置文件。

When you run the artemis create command to create an instance of the broker you can either set JAVA_HOME in your environment (eg export JAVA_HOME=/path/to/jdk ) or you can modify the artemis script directly.当您运行artemis create命令创建代理实例时,您可以在您的环境中设置JAVA_HOME (例如export JAVA_HOME=/path/to/jdk )或者您可以直接修改artemis脚本。

Once the instance is created then the proper place to configure JAVA_HOME is in etc/artemis.profile .创建实例后,配置JAVA_HOME的正确位置是在etc/artemis.profile中。 Just add a line like this:只需添加这样一行:

JAVA_HOME=/path/to/jdk

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

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