arthas icon indicating copy to clipboard operation
arthas copied to clipboard

windows 本地编译打包源码, arthas-vmtool模块报错,jdk11

Open lomodays207 opened this issue 1 year ago • 1 comments

  • [x] 我已经在 issues 里搜索,没有重复的issue。

环境信息

  • Arthas 版本: master 分支代码 4.0.0

  • JDK版本: C:\Users\grant>java -version java version "11.0.2" 2019-01-15 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)、

  • 操作系统版本: image

  • gcc版本信息:

C:\Users\grant>gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=D:/tools/w64devkit-1.23.0/w64devkit/bin/../libexec/gcc/x86_64-w64-mingw32/14.1.0/lto-wrapper.exe Target: x86_64-w64-mingw32 Configured with: /gcc-14.1.0/configure --prefix=/w64devkit --with-sysroot=/w64devkit/x86_64-w64-mingw32 --with-native-system-header-dir=/include --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-static --disable-shared --with-pic --with-gmp-include=/deps/include --with-gmp-lib=/deps/lib --with-mpc-include=/deps/include --with-mpc-lib=/deps/lib --with-mpfr-include=/deps/include --with-mpfr-lib=/deps/lib --enable-languages=c,c++ --enable-libgomp --enable-threads=posix --enable-version-specific-runtime-libs --disable-dependency-tracking --disable-lto --disable-multilib --disable-nls --disable-win32-registry --enable-mingw-wildcard CFLAGS_FOR_TARGET=-Os CXXFLAGS_FOR_TARGET=-Os LDFLAGS_FOR_TARGET=-s CFLAGS=-Os CXXFLAGS=-Os LDFLAGS=-s Thread model: posix Supported LTO compression algorithms: zlib gcc version 14.1.0 (GCC)

重现问题的步骤

clean package -Dmaven.test.skip=true -DskipTests=true -Dmaven.javadoc.skip=true -f pom.xml

期望的结果

打包成功

实际运行的结果

Failed to execute goal org.codehaus.mojo:native-maven-plugin:1.0-alpha-11:compile (compile-and-link) on project arthas-vmtool: Error executing command line. Exit code:1

[INFO] --- native-maven-plugin:1.0-alpha-11:compile (compile-and-link) @ arthas-vmtool ---
[INFO] cmd.exe /X /C "g++ -I${JAVA_HOME}/include -I${JAVA_HOME}/include/win32 -IG:\study\Java\arthas\arthas\arthas-vmtool\target/native/include -m64 -fpic -shared -o -IG:\study\Java\arthas\arthas\arthas-vmtool\src\main\native\src -IG:\study\Java\arthas\arthas\arthas-vmtool\target\generated-sources\annotations -ID:\study\Java\jdk-11.0.2_windows-x64_bin\jdk-11.0.2\..\include -ID:\study\Java\jdk-11.0.2_windows-x64_bin\jdk-11.0.2\..\include\win32 -oG:\study\Java\arthas\arthas\arthas-vmtool\target\objs\jni-library.obj -c G:\study\Java\arthas\arthas\arthas-vmtool\src\main\native\src\jni-library.cpp"
G:\study\Java\arthas\arthas\arthas-vmtool\src\main\native\src\jni-library.cpp:2:10: fatal error: jni.h: No such file or directory
    2 | #include <jni.h>
      |          ^~~~~~~
compilation terminated.

lomodays207 avatar Sep 14 '24 04:09 lomodays207

windows下运行arthas 中运行vmtool指令 无法获取到环境变量 JAVA_HOME 设置一下重新看看

lxyyouxiang123 avatar Oct 12 '24 02:10 lxyyouxiang123