Hi all. Having a problem building vtk_9.4.0 on windows / Java. The error below is just a sample of the 120 error that come up. they are all wrapping errors that fail on code 1. I am out of my depth on these errors and have no idea which way to turn.
Please help. Thanks very much.
Custom build for ‘C:\vtk\vtkBinaries_9.4.0\CMakeFiles\37298a315299d8de439efe09fe10d7c1\vtkColorSeries.java.rule;C:\vtk\vtkBinaries_9.4.0\CMakeFiles\37298a315299d8de439efe09fe10d7c1\vtkNamedColors.java.rule;C:\vtk\vtkBinaries_9.4.0\CMakeFiles\ccd1784ea5325db0188fdb455b80e4de\vtkCommonColorJava-java-sources.rule;C:\vtk\VTK-9.4.0\Wrapping\Java\CMakeLists.txt’ exited with code 1.
Thanks very much Paulo. Let me give as full an explanation as possible. I have been struggling with 9.x.x but 9.3.1 built without error but would not run.
I will put together a full story and send it in. I am very relieved that someone can and is willing to help. Thanks again
vs2022 language standard setup - vs2022 language std.png
vs2022 build log - vs2022_build_log.txt
vs2022 error log - vs2022 error log.txt
I manually copied the errors and may have included warnings there too.
My java is jdk1.8.0_431 (I am planning to upgrade to Java 23 and 64bit vtk once my 9.4.0 is working on 32bit). I am currently using vtk 8.2.0 on jdk1.8.0_431.
My visual studio is - Visual Studio 2022 v17.12
I trust that is all the relevant information.
It seems to be a file missing. Can you, in CMake window, disable “Grouped” and enter “java” in the search field? Please, share what appears. Maybe you need to enable something in VTK configuration.
I strongly suspect that the only way to build VTK with Java on Windows is with the “Ninja” generator, so make sure that you select “Ninja” as the generator when you run cmake. The “Visual Studio” generators will probably not work.
The “Ninja” generator will use the compiler from Visual Studio, so don’t worry, you won’t have to install a different compiler.
After running cmake, open a command-line shell and run “ninja” from your VTK binary directory.
Good evening David and thanks very much for the advice. I will most certainly try ninja and, if you don’t mind, could I please come back to you for issues arising?
I will report to you on my attempts. I will install Java 23 as required. Thanks again for offering to help.
So, basically you’re telling CMake to use one Java installation while configuring VTK to use another Java installation. If you don’t have a reason to use two Java installations, try to change that to the same value in Java_JAVA_EXECUTABLE. I don’t know whether this will solve the issue but that often spells trouble if you don’t know exactly what you are doing.
Sorry about that, I didn’t provide good instructions. When building with ninja it’s necessary to run cmake and ninja from within the Visual Studio Command Prompt, since it sets all of the necessary environment variables for the compiler and the SDK.
I will look them up. Ninja just may enable 9.4.0 for me. All the way up to 8.2.0, I just kind of pressed a button to build the version. Version 9 is different, to say the least. Thanks very much