# Eclipse java support

**URL:** https://discourse.kitware.com/t/eclipse-java-support/372
**Category:** Pulse Physiology Engine
**Created:** [January 6, 2020, 8:52pm UTC](https://discourse.kitware.com/t/eclipse-java-support/372 "2020-01-06T20:52:37Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![bob.marinier](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/b/7ab992/32.png) [@bob.marinier](https://discourse.kitware.com/u/bob.marinier)
#### Post date: [January 6, 2020, 8:52pm UTC](https://discourse.kitware.com/t/eclipse-java-support/372/1 "2020-01-06T20:52:37Z")

</div>

I see eclipse support mentioned, but on the main wiki page ([https://gitlab.kitware.com/physiology/engine/-/wikis/home](https://gitlab.kitware.com/physiology/engine/-/wikis/home)), the link to eclipse instructions appears to go nowhere. I tried the intellij instructions, but I get tons of compiler errors for `HowTo_EngineUse.java` (e.g., the cdm package doesn’t exist). (And anyway I’d rather use Eclipse.)

I’m using the 2.2.0 release code from here: [https://gitlab.kitware.com/physiology/engine/-/releases](https://gitlab.kitware.com/physiology/engine/-/releases)

I also tried getting the latest version of `HowTo_EngineUse.java` from master and the 2.x branch. There were definitely changes relative to what is in the release, but I’m still getting similar build errors.

Is this a known issue? Should I be grabbing the latest off master rather than the release? What’s the status of eclipse vs. intellij? Thanks!

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [January 6, 2020, 9:05pm UTC](https://discourse.kitware.com/t/eclipse-java-support/372/2 "2020-01-06T21:05:30Z")

</div>

I use eclipse pretty regularly, so it has way better support than intellij.

Use 2.x brach. I will be tagging a new release next week sometime, and merging it into master.

There are eclipse projects in the repo, just point eclipse to the source root and it should find them. There is also an eclipse variable you will need to set to the path location to you source and/or build folder. (look at the problems tab, it should note which variable it is.

You are correct, there is no eclipse support page. I will work on that ASAP and correct any mistakes and clarify any details here. I apologize for that.

Also note that there seems to be a problem with the protobuf provided Java code. But everything runs fine, but eclipse will bug you about a build error in the auto-generated code in the Data Model Bindings project.

---

<div class="post-metadata">

### Author: ![bob.marinier](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/b/7ab992/32.png) [@bob.marinier](https://discourse.kitware.com/u/bob.marinier)
#### Post date: [January 6, 2020, 10:32pm UTC](https://discourse.kitware.com/t/eclipse-java-support/372/3 "2020-01-06T22:32:04Z")

</div>

I cloned the 2.x branch. I followed the MSVC instructions on the wiki and was able to build Pulse-SuperBuild.sln just fine. I then tried to build Pulse.sln in Debug as instructed, and I get the error:

> Cannot open include file: ‘properties/SEScalarFlowCompliance.h’: No such file or directory PulseCLR pulse-engine\source\engine\clr\PulseEngine.cpp 11

I’m using VS 2015.

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [January 7, 2020, 1:37am UTC](https://discourse.kitware.com/t/eclipse-java-support/372/4 "2020-01-07T01:37:50Z")

</div>

Hmm  
It looks like you enabled the CLR option.  
I have since been concentrating on a C to C# Api rather than the CLR via managed C++. Unity prefers the C style encapsulation. So I can see it having build issues with it.

I am probably going to disable the ability to build the CLR until someone has a need for it rather than the newer C# encapsulation.

---

<div class="post-metadata">

### Author: ![bob.marinier](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/b/7ab992/32.png) [@bob.marinier](https://discourse.kitware.com/u/bob.marinier)
#### Post date: [January 7, 2020, 2:17pm UTC](https://discourse.kitware.com/t/eclipse-java-support/372/5 "2020-01-07T14:17:54Z")

</div>

Without the CLR option, it builds! The only reason I selected that option was because the instructions here mention it: [https://gitlab.kitware.com/physiology/engine/-/wikis/Using%20MSVC](https://gitlab.kitware.com/physiology/engine/-/wikis/Using%20MSVC)

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [January 7, 2020, 3:48pm UTC](https://discourse.kitware.com/t/eclipse-java-support/372/6 "2020-01-07T15:48:17Z")

</div>

Great!  
Thanks for taking the time to read and report your issues. I’ll be sure to review and update these docs before our next release (next week)

---

<div class="post-metadata">

### Author: ![bob.marinier](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/b/7ab992/32.png) [@bob.marinier](https://discourse.kitware.com/u/bob.marinier)
#### Post date: [January 7, 2020, 4:27pm UTC](https://discourse.kitware.com/t/eclipse-java-support/372/7 "2020-01-07T16:27:10Z")

</div>

I have the java projects imported into Eclipse, and the `SOURCE_DIR` classpath variable is set so everything builds (and I have the expected protobuf error).

I was able to run `HowTo_Engine` (which appears to assume that the working directory is `<pulse/bin>`). So I set that as the working directory, and when I run it, it eventually gets a fatal error:

```auto
INFO HowTo_EngineUse::258::Total Lung Volume 2224.337605484883mL
INFO HowTo_EngineUse::259::Blood Volume 5600.049485623451mL
INFO HowTo_EngineUse$MyListener::61:: : [1.02(s)] [Action] 1.02(s), Patient Action : Hemorrhage
	Rate: 200(mL/min)
	For Compartment: RightLeg
	Type: External
FATAL HowTo_EngineUse$MyListener::64:: : [39.22(s)] Can't transport with a negative volume included. Node = RightLegVasculature. Volume = -0.0191784 mL
FATAL:Can't transport with a negative volume included. Node = RightLegVasculature. Volume = -0.0191784 mL : 
JNI Caught Exception [39.22(s)] Can't transport with a negative volume included. Node = RightLegVasculature. Volume = -0.0191784 mL 
ERROR HowTo_EngineUse::278::Engine was unable to stay within modeling parameters with requested actions

```

For `HowTo_RunScenario`, it appears to assume it is in both `<pulse/bin>` (to load the native libs) and in `<pulse/source>` (e.g., line 109 wants to load a scenario file from a path that appears to be relative to that location). How is this intended to be run? I tried setting `java.library.path` to `<pulse/bin>` and making `<pulse/source>` the working directory, but the code in `jniBridge.java` appears to assume the working directory as the location of the libraries, so this does not work.

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [January 7, 2020, 7:53pm UTC](https://discourse.kitware.com/t/eclipse-java-support/372/8 "2020-01-07T19:53:59Z")

</div>

I must not have updated this driver.  
A 200mL from the leg is too much.

Set it to about 75mL

Refer to this issue, which should be addressed in the next few months  
[https://gitlab.kitware.com/physiology/engine/issues/19](https://gitlab.kitware.com/physiology/engine/issues/19)

---

<div class="post-metadata">

### Author: ![bob.marinier](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/b/7ab992/32.png) [@bob.marinier](https://discourse.kitware.com/u/bob.marinier)
#### Post date: [January 7, 2020, 8:40pm UTC](https://discourse.kitware.com/t/eclipse-java-support/372/9 "2020-01-07T20:40:16Z")

</div>

That worked! For future readers, the change was on this line towards the end of the `example()` method:

```java
h.getRate().setValue(75,VolumePerTimeUnit.mL_Per_min);

```
