# vtk module with JAVA wrapping

**URL:** <https://discourse.vtk.org/t/vtk-module-with-java-wrapping/15391>\
**Category:** Support\
**Created:** [March 14, 2025, 12:19pm UTC](https://discourse.vtk.org/t/vtk-module-with-java-wrapping/15391 "2025-03-14T12:19:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![metamurk](https://discourse.vtk.org/user_avatar/discourse.vtk.org/metamurk/32/9665_2.png) [@metamurk](https://discourse.vtk.org/u/metamurk)\
**Post date:** [March 14, 2025, 12:19pm UTC](https://discourse.vtk.org/t/vtk-module-with-java-wrapping/15391/1 "2025-03-14T12:19:48Z")

</div>

Hello together,

We are working on migrating our code from vtk 7 to vtk 9.4.1. We use the java wrapping functionality. In the actual version, there is in “Examples\Build\vtkMy” an example how to build a custom module. In the Cmake there is block creating python wrappings:

```auto
if(VTK_WRAP_PYTHON)
  vtk_module_wrap_python(
    MODULES ${my_modules}
    INSTALL_EXPORT VTKMY
    PYTHON_PACKAGE "vtkmy"
    CMAKE_DESTINATION "${my_config_dir}"
    BUILD_STATIC OFF)
endif()

```

But not for java,. Adding a similar block for java fails:

```auto
  vtk_module_wrap_java(
    MODULES ${my_modules}
    INSTALL_EXPORT VTKVEO
    JAVA_PACKAGE "org.vtk.veo"
    CMAKE_DESTINATION "${my_config_dir}"
    BUILD_STATIC OFF) .

```

with an error:

```auto
CMake Error at C:/VEO_MIDO_BUILD/VTK_BUILD/RELEASE_BUILD/lib/cmake/vtk-9.4/vtkModule.cmake:2172 (get_property):
  get_property could not find TARGET OFF. Perhaps it has not yet been
  created.
Call Stack (most recent call first):
  C:/VEO_MIDO_BUILD/VTK_BUILD/RELEASE_BUILD/lib/cmake/vtk-9.4/vtkModuleWrapJava.cmake:257 (_vtk_module_get_module_property)
  C:/VEO_MIDO_BUILD/VTK_BUILD/RELEASE_BUILD/lib/cmake/vtk-9.4/vtkModuleWrapJava.cmake:516 (_vtk_module_wrap_java_library)
  CMakeLists.txt:127 (vtk_module_wrap_java)

```

Can anybody help to compile local VTK classes and wrapped into  
C++/Java how it was possible in earlier VTK versions?

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)\
**Post date:** [March 14, 2025, 5:43pm UTC](https://discourse.vtk.org/t/vtk-module-with-java-wrapping/15391/2 "2025-03-14T17:43:15Z")

</div>

Interesting. Not sure why it fails _there_, but the arguments you have are not parsed because only `MODULES` is actually a keyword that is recognized. See [the docs](https://docs.vtk.org/en/latest/api/cmake/vtkModuleWrapJava.html#command:vtk_module_wrap_java) for the arguments actually supported.
