VTK java.lang.UnsatisfiedLinkError

Trying to run/debug my project using intellij (windows), got errors like:

java.lang.UnsatisfiedLinkError: no vtk{Anything} in java.library.path

{Anything} can be any class of vtk i’m trying to use, for example:

java.lang.UnsatisfiedLinkError: no vtkRenderingCoreJava in java.library.path
java.lang.UnsatisfiedLinkError: no vtkFiltersModelingJava in java.library.path
java.lang.UnsatisfiedLinkError: no vtkViewsContext2DJava in java.library.path
etc...

I know this problem can be solved adding -Djava.library.path= to VM option. I had a very similar problem with simpleITK and solved it: Where do i get SimpleITK JNI Lib?

But my answer now is: How can i get JNI lib for vtk? Or native lib? Or any file that solves my problem? I tried with this one but doesn’t work: https://people.ece.ubc.ca/andrewkh/vtk-jni.html

then, i try following this: installation of vtk 9.0 with python, java wrappers

i ‘git clone VTK’ and use cmake/visual-studio to make a build. configuration is Debug x64 ALL-BUILD, using VTK_WRAP_JAVA=ON. my build finish with no errors, but now i dont know what is the path to the file that i need to put into -Djava.library.path=

Normally if your target is just Java, you have other options (in cmake) that will build a jar with those dlls in. So that path should not be an issue either.

1 Like

Can you please provide the names of these options? Or at least give me an idea of what they are called? Thanks!!

just for complement, running this:

        int totalNotLoaded = 0;
        if (!vtkNativeLibrary.LoadAllNativeLibraries()) {
            for (vtkNativeLibrary lib : vtkNativeLibrary.values()) {
                if (!lib.IsLoaded()) {
                    totalNotLoaded += 1;
                    System.out.println(totalNotLoaded + " - " + lib.GetLibraryName() + " NOT LOADED");
                }
            }
        }
        vtkNativeLibrary.DisableOutputWindow(null);

prints this:

1 - vtkViewsInfovisJava NOT LOADED
2 - vtkCommonColorJava NOT LOADED
3 - vtkViewsContext2DJava NOT LOADED
4 - vtkTestingRenderingJava NOT LOADED
5 - vtkRenderingVolumeOpenGL2Java NOT LOADED
6 - vtkRenderingLabelJava NOT LOADED
7 - vtkRenderingLODJava NOT LOADED
8 - vtkRenderingImageJava NOT LOADED
9 - vtkRenderingContextOpenGL2Java NOT LOADED
10 - vtkIOVeraOutJava NOT LOADED
11 - vtkIOTecplotTableJava NOT LOADED
12 - vtkIOSegYJava NOT LOADED
13 - vtkIOParallelXMLJava NOT LOADED
14 - vtkIOParallelJava NOT LOADED
15 - vtkIOPLYJava NOT LOADED
16 - vtkIOOggTheoraJava NOT LOADED
17 - vtkIONetCDFJava NOT LOADED
18 - vtkIOMotionFXJava NOT LOADED
19 - vtkIOMINCJava NOT LOADED
20 - vtkIOLSDynaJava NOT LOADED
21 - vtkIOInfovisJava NOT LOADED
22 - vtkIOImportJava NOT LOADED
23 - vtkIOIOSSJava NOT LOADED
24 - vtkIOHDFJava NOT LOADED
25 - vtkIOVideoJava NOT LOADED
26 - vtkIOMovieJava NOT LOADED
27 - vtkIOExportPDFJava NOT LOADED
28 - vtkIOExportGL2PSJava NOT LOADED
29 - vtkRenderingGL2PSOpenGL2Java NOT LOADED
30 - vtkIOExportJava NOT LOADED
31 - vtkRenderingVtkJSJava NOT LOADED
32 - vtkIOGeometryJava NOT LOADED
33 - vtkRenderingSceneGraphJava NOT LOADED
34 - vtkIOExodusJava NOT LOADED
35 - vtkIOEnSightJava NOT LOADED
36 - vtkIOCityGMLJava NOT LOADED
37 - vtkIOChemistryJava NOT LOADED
38 - vtkIOCONVERGECFDJava NOT LOADED
39 - vtkIOCGNSReaderJava NOT LOADED
40 - vtkIOAsynchronousJava NOT LOADED
41 - vtkIOAMRJava NOT LOADED
42 - vtkInteractionImageJava NOT LOADED
43 - vtkImagingStencilJava NOT LOADED
44 - vtkImagingStatisticsJava NOT LOADED
45 - vtkImagingMorphologicalJava NOT LOADED
46 - vtkImagingMathJava NOT LOADED
47 - vtkImagingFourierJava NOT LOADED
48 - vtkIOSQLJava NOT LOADED
49 - vtkGeovisCoreJava NOT LOADED
50 - vtkInfovisLayoutJava NOT LOADED
51 - vtkViewsCoreJava NOT LOADED
52 - vtkInteractionWidgetsJava NOT LOADED
53 - vtkRenderingVolumeJava NOT LOADED
54 - vtkRenderingAnnotationJava NOT LOADED
55 - vtkImagingHybridJava NOT LOADED
56 - vtkImagingColorJava NOT LOADED
57 - vtkInteractionStyleJava NOT LOADED
58 - vtkFiltersTopologyJava NOT LOADED
59 - vtkFiltersSelectionJava NOT LOADED
60 - vtkFiltersSMPJava NOT LOADED
61 - vtkFiltersProgrammableJava NOT LOADED
62 - vtkFiltersPointsJava NOT LOADED
63 - vtkFiltersVerdictJava NOT LOADED
64 - vtkFiltersParallelImagingJava NOT LOADED
65 - vtkFiltersImagingJava NOT LOADED
66 - vtkImagingGeneralJava NOT LOADED
67 - vtkFiltersHyperTreeJava NOT LOADED
68 - vtkFiltersGenericJava NOT LOADED
69 - vtkFiltersFlowPathsJava NOT LOADED
70 - vtkFiltersAMRJava NOT LOADED
71 - vtkFiltersParallelJava NOT LOADED
72 - vtkFiltersTextureJava NOT LOADED
73 - vtkFiltersModelingJava NOT LOADED
74 - vtkFiltersHybridJava NOT LOADED
75 - vtkDomainsChemistryOpenGL2Java NOT LOADED
76 - vtkRenderingOpenGL2Java NOT LOADED
77 - vtkRenderingUIJava NOT LOADED
78 - vtkDomainsChemistryJava NOT LOADED
79 - vtkChartsCoreJava NOT LOADED
80 - vtkInfovisCoreJava NOT LOADED
81 - vtkFiltersExtractionJava NOT LOADED
82 - vtkIOXMLJava NOT LOADED
83 - vtkIOXMLParserJava NOT LOADED
84 - vtkParallelCoreJava NOT LOADED
85 - vtkIOLegacyJava NOT LOADED
86 - vtkIOCoreJava NOT LOADED
87 - vtkFiltersStatisticsJava NOT LOADED
88 - vtkImagingSourcesJava NOT LOADED
89 - vtkIOImageJava NOT LOADED
90 - vtkRenderingContext2DJava NOT LOADED
91 - vtkRenderingFreeTypeJava NOT LOADED
92 - vtkRenderingCoreJava NOT LOADED
93 - vtkFiltersSourcesJava NOT LOADED
94 - vtkImagingCoreJava NOT LOADED
95 - vtkFiltersGeometryJava NOT LOADED
96 - vtkFiltersGeneralJava NOT LOADED
97 - vtkCommonComputationalGeometryJava NOT LOADED
98 - vtkFiltersCoreJava NOT LOADED
99 - vtkCommonExecutionModelJava NOT LOADED
100 - vtkCommonDataModelJava NOT LOADED
101 - vtkCommonSystemJava NOT LOADED
102 - vtkCommonMiscJava NOT LOADED
103 - vtkCommonTransformsJava NOT LOADED
104 - vtkCommonMathJava NOT LOADED
105 - vtkCommonCoreJava NOT LOADED

run ccmake or cmake-gui and search for java.

there is just one named VTK_WRAP_JAVA, i tagged it and did the build.
No errors, but now where are the dll’s?

Nothing more in the advanced list? If that is the case, maybe it happen by default on install. Did you run cmake --install --prefix ./install .