Xi Minghui
Xi Minghui

Reputation: 390

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. 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.

I first did a test installation on my Windows machine. 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.

Is there an elegant way to configure JDK for Artemis? Like modifying some Artemis configuration files.

Upvotes: 0

Views: 1559

Answers (1)

Justin Bertram
Justin Bertram

Reputation: 34988

When you run the artemis create command to create an instance of the broker you can either set JAVA_HOME in your environment (e.g. export JAVA_HOME=/path/to/jdk) or you can modify the artemis script directly.

Once the instance is created then the proper place to configure JAVA_HOME is in etc/artemis.profile. Just add a line like this:

JAVA_HOME=/path/to/jdk

Upvotes: 1

Related Questions