# Java in a Sandbox

**URL:** https://talk.remobjects.com/t/java-in-a-sandbox/21450
**Category:** Hydra
**Tags:** java, delphi
**Created:** [February 25, 2020, 9:56am UTC](https://talk.remobjects.com/t/java-in-a-sandbox/21450 "2020-02-25T09:56:51Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Jan\_Florian\_Siems](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@Jan\_Florian\_Siems](https://talk.remobjects.com/u/Jan_Florian_Siems)
#### Post date: [February 25, 2020, 9:56am UTC](https://talk.remobjects.com/t/java-in-a-sandbox/21450/1 "2020-02-25T09:56:52Z")

</div>

Hello Community,  
i might need some wisdom for an idea i have regarding delphi host java plugin communication.  
Other products we distribute using tomcat with a jre-sandbox, means we can use java 1.8 for our tomcat and java services without the requirement of reading the envirement… Can i setup such way through hydra? Would be Awesome!

Edit: uHYJavaVM.THYJavaVM.Create access through GetJavaRuntimePath(‘JAVA\_HOME’). I would love if there would be a statement like:

constructor THYJavaVM.Create(bridgeJarFilename: String; additionalOptions: array of String);  
var  
runtimePath: String;  
begin  
runtimePath := GetJavaRuntimePath(‘HYDRA\_JAVA\_HOME’);  
if(Trim(runtimePath) = ‘’) then  
begin  
runtimePath := GetJavaRuntimePath(‘JAVA\_HOME’);  
end;

if runtimePath = ‘’ then raise EJvmException.Create(‘Cannot find Java installation path’);  
InitializeJavaVM(runtimePath, bridgeJarFilename, additionalOptions);  
end;

this would allow to setup alternative JRE Versions regardless what official version users have been installed.

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [February 25, 2020, 12:36pm UTC](https://talk.remobjects.com/t/java-in-a-sandbox/21450/3 "2020-02-25T12:36:08Z")

</div>

> [@Jan\_Florian\_Siems](#):
>
> Can i setup such way through hydra?

you can launch your application with batch file (.cmd) like

```auto
set tempjavahome=%JAVA_HOME%
set JAVA_HOME=C:\Program Files (x86)\Java\jdk1.8
start my_hydra_app.exe
set JAVA_HOME=%tempjavahome%

```

* * *

Thanks for idea. I’ll log issues for adding `HYDRA_JAVA_HOME` variables.

---

<div class="post-metadata">

### Author: ![RemObjectsSoftware](https://talk.remobjects.com/user_avatar/talk.remobjects.com/remobjectssoftware/32/15947_2.png) [@RemObjectsSoftware](https://talk.remobjects.com/u/RemObjectsSoftware)
#### Post date: [February 25, 2020, 1:04pm UTC](https://talk.remobjects.com/t/java-in-a-sandbox/21450/4 "2020-02-25T13:04:32Z")

</div>

Thanks, logged as [bugs://83987](https://www.remobjects.com/portal/bugs/?id=83987)

---

<div class="post-metadata">

### Author: ![RemObjectsSoftware](https://talk.remobjects.com/user_avatar/talk.remobjects.com/remobjectssoftware/32/15947_2.png) [@RemObjectsSoftware](https://talk.remobjects.com/u/RemObjectsSoftware)
#### Post date: [February 25, 2020, 1:05pm UTC](https://talk.remobjects.com/t/java-in-a-sandbox/21450/5 "2020-02-25T13:05:18Z")

</div>

Thanks, logged as [bugs://83988](https://www.remobjects.com/portal/bugs/?id=83988)

---

<div class="post-metadata">

### Author: ![sschneider](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/s/848f3c/32.png) [@sschneider](https://talk.remobjects.com/u/sschneider)
#### Post date: [February 25, 2020, 3:03pm UTC](https://talk.remobjects.com/t/java-in-a-sandbox/21450/6 "2020-02-25T15:03:05Z")

</div>

thank you for your reply. One more Sidenode : Import Interfaces from java-module would require the same feature. thats not something i would know how to fix from my side.

---

<div class="post-metadata">

### Author: ![RemObjectsSoftware](https://talk.remobjects.com/user_avatar/talk.remobjects.com/remobjectssoftware/32/15947_2.png) [@RemObjectsSoftware](https://talk.remobjects.com/u/RemObjectsSoftware)
#### Post date: [March 2, 2020, 1:13pm UTC](https://talk.remobjects.com/t/java-in-a-sandbox/21450/7 "2020-03-02T13:13:39Z")

</div>

[bugs://83988](https://www.remobjects.com/portal/bugs/?id=83988) got closed with status fixed.

---

<div class="post-metadata">

### Author: ![RemObjectsSoftware](https://talk.remobjects.com/user_avatar/talk.remobjects.com/remobjectssoftware/32/15947_2.png) [@RemObjectsSoftware](https://talk.remobjects.com/u/RemObjectsSoftware)
#### Post date: [March 13, 2020, 2:32pm UTC](https://talk.remobjects.com/t/java-in-a-sandbox/21450/8 "2020-03-13T14:32:18Z")

</div>

[bugs://83987](https://www.remobjects.com/portal/bugs/?id=83987) got closed with status fixed.

---

<div class="post-metadata">

### Author: ![Jan\_Florian\_Siems](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@Jan\_Florian\_Siems](https://talk.remobjects.com/u/Jan_Florian_Siems)
#### Post date: [March 26, 2020, 3:14pm UTC](https://talk.remobjects.com/t/java-in-a-sandbox/21450/9 "2020-03-26T15:14:48Z")

</div>

I wanted to try out and test the last beta. Seems like the addin in Radstudio still does not take HYDRA\_JAVA\_HOME as path yet.

![2020-03-26_16h13_50](https://talk.remobjects.com/uploads/default/original/2X/d/ddc560ea6b89121e85149c6097c3915e301fe1dd.png)

 ![2020-03-26_16h14_09](https://talk.remobjects.com/uploads/default/original/2X/4/453eb5f45eb42ea75118243359e9582fcc584f52.png)

So the most urgent part of this task is still required and open.

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [March 26, 2020, 3:18pm UTC](https://talk.remobjects.com/t/java-in-a-sandbox/21450/10 "2020-03-26T15:18:14Z")

</div>

Hi,  
what version of Hydra you are using?  
the latest preview - v6.2.101.1243 ?

---

<div class="post-metadata">

### Author: ![Jan\_Florian\_Siems](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@Jan\_Florian\_Siems](https://talk.remobjects.com/u/Jan_Florian_Siems)
#### Post date: [March 26, 2020, 4:02pm UTC](https://talk.remobjects.com/t/java-in-a-sandbox/21450/11 "2020-03-26T16:02:40Z")

</div>

RemObjects Hydra - 6.2.101.1243

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [March 26, 2020, 4:17pm UTC](https://talk.remobjects.com/t/java-in-a-sandbox/21450/12 "2020-03-26T16:17:36Z")

</div>

try to set `HYDRA_JAVA_HOME` as a local user or global system variable.  
.NET wizard may not see a variable declared in Delphi IDE.

---

<div class="post-metadata">

### Author: ![Jan\_Florian\_Siems](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@Jan\_Florian\_Siems](https://talk.remobjects.com/u/Jan_Florian_Siems)
#### Post date: [March 27, 2020, 5:41am UTC](https://talk.remobjects.com/t/java-in-a-sandbox/21450/13 "2020-03-27T05:41:28Z")

</div>

Good Morning Evgeny,

My issues on this side.. It seems i setup the wrong path. Now it finds JVM properly but i seem to have another issue.

 ![2020-03-27_06h40_57](https://talk.remobjects.com/uploads/default/original/2X/e/e087c47bbb7ca02bf19baeafb9e8d725548596fd.png)

But i guess i did something fatal on eclipse side (still analyzing). Worthy making a new thread?

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [March 27, 2020, 8:09am UTC](https://talk.remobjects.com/t/java-in-a-sandbox/21450/14 "2020-03-27T08:09:39Z")

</div>

Hi,

yes , new thread will be better for new issue
