# VTK + Java + MacOS, awt error

**URL:** https://discourse.vtk.org/t/vtk-java-macos-awt-error/5586
**Category:** Support
**Created:** [April 19, 2021, 10:13pm UTC](https://discourse.vtk.org/t/vtk-java-macos-awt-error/5586 "2021-04-19T22:13:58Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![thegbiv](https://discourse.vtk.org/user_avatar/discourse.vtk.org/thegbiv/32/2784_2.png) [@thegbiv](https://discourse.vtk.org/u/thegbiv)
#### Post date: [April 19, 2021, 10:13pm UTC](https://discourse.vtk.org/t/vtk-java-macos-awt-error/5586/1 "2021-04-19T22:13:58Z")

</div>

Hello again. In my quest to “get back into VTK shape” I’ve been trying to build/run VTK in various configurations to learn what’s changed since I’ve last used the API.  
One issue that I’ve run into, is that I get some strange error from awt when running on mac.

```bash

# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x000000012f2e8f75, pid=68257, tid=0x000000000000a303
#
# JRE version: OpenJDK Runtime Environment (8.0_282-b08) (build 1.8.0_282-b08)
# Java VM: OpenJDK 64-Bit Server VM (25.282-b08 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# **C [libawt_lwawt.dylib+0x44f75] JNI_OnLoad+0xa0**
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
# https://github.com/AdoptOpenJDK/openjdk-support/issues
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

```

I’ve seen various posts about problems with Mac+Java+VTK but what I can’t find is a definitive solution for developing on Mac with Java bindings.  
To try to simplify things, I’m currently not interested in rendering, I just want to read a `vtkDataObject` (vtk,vtp,vtu,vti,vtm etc) possibly transform the data via some filters, and then query information about the results (geometry with properties). So here are my questions:

1. Are there some instructions for building Java wrappers (OpenJDK 8 or greater) + Mac (11.2.3) + VTK (9.\*)?
2. What is a minimum configuration for building VTK without rendering (no GL, no Mesa, no RayTracing)?

Thanks for any advice here.  
Gerrick

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [April 20, 2021, 7:41pm UTC](https://discourse.vtk.org/t/vtk-java-macos-awt-error/5586/2 "2021-04-20T19:41:54Z")

</div>

Can you skim through [#17831](https://gitlab.kitware.com/vtk/vtk/-/issues/17831) to see if it has any connection to the error? Unfortunately I can’t give details on doing a vtk-java build on macOS, it’s been way too long since I’ve done one myself, but hopefully someone else on the list can fill in the details.

---

<div class="post-metadata">

### Author: ![thegbiv](https://discourse.vtk.org/user_avatar/discourse.vtk.org/thegbiv/32/2784_2.png) [@thegbiv](https://discourse.vtk.org/u/thegbiv)
#### Post date: [April 21, 2021, 3:23pm UTC](https://discourse.vtk.org/t/vtk-java-macos-awt-error/5586/3 "2021-04-21T15:23:34Z")

</div>

Hey David…thanks for the pointer…I don’t think that was my issue however, I was certainly playing whack-a-mole trying to figure something out here. One detail I left out here was that I was running all this from my IDE, which has worked for me in the past with python(PyCharm). My setup, in this case, was with IntelliJ and I was trying to invoke this from a unit test (JUnit framework). That was failing horribly. I eventually just made a main class and voila, everything worked. So I’m assuming, the framework wasn’t loading up awt and friends properly or something along those lines when spinning up the unit test. 🤷‍♂️

As I said, I’m not sure where exactly I landed because I rebuilt vtk with varying configurations while trying to figure this out but I do believe the real problem was with the unit test setup…Seems like a problem for another day. Thanks again

Gerrick
