java - VTK:使用 Java Wrappers 编译 - 缺少 vtk.jar
问题描述
我正在尝试在 Windows 10 下构建 VTK,以便使用 Visual Studio 2019 基本上根据本教程和本教程在Java中使用。该cmake
部分似乎工作正常。我最终得到以下配置:
ALL_BUILD
Visual Studio 中的构建步骤 (Build ) 以管理员身份Release
配置解决方案x64
似乎也可以工作:
========== Build: 437 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
但是,执行INSTALL
以错误结束:
225>CMake Error at Wrapping/Java/cmake_install.cmake:1215 (file):
225> file INSTALL cannot find
225> "[PATH]/VTK-9.0.1/Binaries/lib/java/Release/vtk.jar":
225> File exists.
225>Call Stack (most recent call first):
225> cmake_install.cmake:486 (include)
225>
225>
225>D:\Programme\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: The command "setlocal
225>D:\Programme\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: D:\Programme\CMake\3.20.3\bin\cmake.exe -DBUILD_TYPE=Release -P cmake_install.cmake
225>D:\Programme\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd
225>D:\Programme\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: :cmEnd
225>D:\Programme\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
225>D:\Programme\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: :cmErrorLevel
225>D:\Programme\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: exit /b %1
225>D:\Programme\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: :cmDone
225>D:\Programme\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd
225>D:\Programme\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: :VCEnd" exited with code 1.
225>Done building project "INSTALL.vcxproj" -- FAILED.
确实,其中有很多*.exp
和*.lib
文件,[PATH]/VTK-9.0.1/Binaries/lib/java/Release/
但vtk.jar
缺少 a。
任何想法我做错了什么?
解决方案
好的,最好多搜索 3 分钟。但为了完整起见,这里是解决方案:
精华:
VS cmake 不知道如何构建 java 文件,因此构建 jar 文件的最后阶段必须从 vtk 9.0.0 开始手动完成
链接中的相关代码
cd $vtk_build_dir\Wrapping\Java
dir /s/B *.java >javafiles
javac -d ..\..\java @javafiles
cd ..\..\java
jar --create -f ..\lib\java\vtk.jar vtk\*.class
推荐阅读
- python - 使用 s3 和 python 编写和读取列表列表
- c++ - 编写程序使用动态解决货币行问题
- javascript - 为什么我的悬停功能有效,但我的 onmouseleave 功能无效?(在控制台中调用该函数有效)
- node.js - Cordova Electron 应用程序,openFileDialog 事件
- python - 数据框列中存在的字典中键的映射值
- c# - 无法解析“Microsoft.AspNetCore.Identity.UserManager”类型的服务
- php - ACF 归档 - 添加链接不起作用的按钮
- amazon-web-services - 使用 Elastic Beanstalk 在实例启动时运行 Windows Powershell 脚本
- complex-numbers - 要显示的复杂 h5 文件
- python - Folium 中的 FeatureGroup 图层控制 - 只有一个活动图层