# Rock 2.0 and the transition to Java 21

**URL:** <https://datashield.discourse.group/t/rock-2-0-and-the-transition-to-java-21/1011>\
**Category:** Developer support\
**Created:** [25 April 2024 10:42 UTC](https://datashield.discourse.group/t/rock-2-0-and-the-transition-to-java-21/1011 "2024-04-25T10:42:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![aakkoc](https://yyz2.discourse-cdn.com/free1/user_avatar/datashield.discourse.group/aakkoc/32/200_2.png) [@aakkoc](https://datashield.discourse.group/u/aakkoc)\
**Post date:** [25 April 2024 10:42 UTC](https://datashield.discourse.group/t/rock-2-0-and-the-transition-to-java-21/1011/1 "2024-04-25T10:42:03Z")

</div>

Hi, I have a question about Rock and some current developments in the DataSHIELD ecosystem.

In late March, [Rock 2.0](https://www.obiba.org/pages/news/release/rock/2.0/) was released. Notably, Rock 2.0 updates the Java version from 8(?)to Java 21. Many of the other DataSHIELD components such as Opal, Armadillo, Mica continue to use Java 8. For **non-Docker deployments** this change can lead to conflicts between some tools expecting Java 8 and others expecting Java 21 from the `/usr/bin/java` path.

With some configurations, it’s possible to have two versions of Java on the same system and to reference the appropriate one.

> **Upgrade actions** - If the default Java installed in your system is not Java 21, you must install Java 21 (any vendor), update the path to the _java_ executable in the file `/etc/default/rock` , and restart the `rock` service.

For myself, I recently updated the R version on a Rock server we had, through `/var/lib/rock/conf/application.yml`, under the `r.exec` entry. And I know that the Java executable that Rock should be using is set in the same way. So hopefully, this will save your projects on non-Docker set-ups.

What I would like to ask is if we can expect the rest of the DataSHIELD suite to also bump their Java up to Java 21? Some time ago I and @yannick were discussing that Java 8 was now quite outdated\*. Is there alredy any ongoing effort to upgrade the Java version accross DataSHIELD projects?

\*See [Opal Crashes after Restart (Error creating bean with name 'jotm')](https://datashield.discourse.group/t/opal-crashes-after-restart-error-creating-bean-with-name-jotm/988)

---

<div class="post-metadata">

**Author:** ![swheater](https://yyz2.discourse-cdn.com/free1/user_avatar/datashield.discourse.group/swheater/32/182_2.png) [@swheater](https://datashield.discourse.group/u/swheater)\
**Post date:** [25 April 2024 11:12 UTC](https://datashield.discourse.group/t/rock-2-0-and-the-transition-to-java-21/1011/2 "2024-04-25T11:12:16Z")

</div>

Hi, The main use of Java in the DataSHIELD ecosystem is in Opal, Armadillo and Rock. Both Opal and Armadillo are engaged in the progress of updating the version of Java used. I will leave it to them to indicate current state of the process. The Rock 2.0 now uses(/requires) Java 21, so I have started the process of rebuilding and testing DataSHIELD Profiles based on Rock 2.0. I am currently concentrating “xenon”

Stuart

---

<div class="post-metadata">

**Author:** ![yannick](https://yyz2.discourse-cdn.com/free1/user_avatar/datashield.discourse.group/yannick/32/19_2.png) [@yannick](https://datashield.discourse.group/u/yannick)\
**Post date:** [25 April 2024 19:05 UTC](https://datashield.discourse.group/t/rock-2-0-and-the-transition-to-java-21/1011/3 "2024-04-25T19:05:14Z")

</div>

Hi,

Yes, the whole OBiBa suite is in the process of being migrated to Java 21. So far, Rock and Agate have been migrated. Mica migration is in progress (task handled by Maelstrom Research), currently in the testing phase. Opal backend has been migrated as well, but frontend (graphical user interface) requires rewritting (GWT framework is obsolete), good progress but there is still a lot to do, there are so many functionalities 🙂

Regards  
Yannick

---

<div class="post-metadata">

**Author:** ![aakkoc](https://yyz2.discourse-cdn.com/free1/user_avatar/datashield.discourse.group/aakkoc/32/200_2.png) [@aakkoc](https://datashield.discourse.group/u/aakkoc)\
**Post date:** [3 October 2024 16:26 UTC](https://datashield.discourse.group/t/rock-2-0-and-the-transition-to-java-21/1011/4 "2024-10-03T16:26:46Z")

</div>

@yannick I decided to go for multiple Java versions with SDKMAN!

Is it possible to give a Java path for Opal? I could not find the variable in `/usr/share/opal/conf/opal-config.properties `?

---

<div class="post-metadata">

**Author:** ![yannick](https://yyz2.discourse-cdn.com/free1/user_avatar/datashield.discourse.group/yannick/32/19_2.png) [@yannick](https://datashield.discourse.group/u/yannick)\
**Post date:** [3 October 2024 17:16 UTC](https://datashield.discourse.group/t/rock-2-0-and-the-transition-to-java-21/1011/5 "2024-10-03T17:16:59Z")

</div>

Hi,

Java path is to be defined in the /etc/default file corresponding to your app: /etc/default/rock or /etc/default/opal there is a JAVA env for specifying the java exec location.

Regards  
Yannick

---

<div class="post-metadata">

**Author:** ![aakkoc](https://yyz2.discourse-cdn.com/free1/user_avatar/datashield.discourse.group/aakkoc/32/200_2.png) [@aakkoc](https://datashield.discourse.group/u/aakkoc)\
**Post date:** [4 October 2024 08:14 UTC](https://datashield.discourse.group/t/rock-2-0-and-the-transition-to-java-21/1011/6 "2024-10-04T08:14:26Z")

</div>

Can confirm as of October 4 2024, that a system-wide Java 21 works provided that Opal (4.7.4.) runs on a custom path.

Java8 path = `/opt/sdkman/candidates/java/8.0.422-amzn/bin/java` (sdkman installed under `/opt` instead of `/$HOME/.sdkman` default)
