jvm-profiling-tools / perf-map-agent

A java agent to generate method mappings to use with the linux `perf` tool
GNU General Public License v2.0
1.64k stars 260 forks source link

cmake error(cmake version is 2.8.12.2) #53

Open liuluo129 opened 7 years ago

liuluo129 commented 7 years ago

i installed cmake, perf, and cmake version is 2.8.12.2, but failed

[root@test perf-map-agent]# cmake .

-- Could NOT find JNI (missing:  JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
JAVA_INCLUDE_PATH (ADVANCED)
   used as include directory in directory /root/perf-map-agent
   used as include directory in directory /root/perf-map-agent
JAVA_INCLUDE_PATH2 (ADVANCED)
   used as include directory in directory /root/perf-map-agent
   used as include directory in directory /root/perf-map-agent

-- Configuring incomplete, errors occurred!
See also "/root/perf-map-agent/CMakeFiles/CMakeOutput.log".
See also "/root/perf-map-agent/CMakeFiles/CMakeError.log".

CMakeError.log

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND
Build flags:
Id flags:

The output was:
No such file or directory

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND
Build flags:
Id flags: -c

The output was:
No such file or directory

Checking whether the CXX compiler is IAR using "" did not match "IAR .+ Compiler":
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND
Build flags:
Id flags:

The output was:
No such file or directory

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND
Build flags:
Id flags: -c

The output was:
No such file or directory

Checking whether the CXX compiler is IAR using "" did not match "IAR .+ Compiler":
alex-dukhno commented 7 years ago

I had the same issue with cmake 2.8.11. I resolved it by exporting JAVA_HOME env variable.

export JAVA_HOME=<path_to_jdk>
cmake .
make
yqf1991 commented 6 years ago

I also have the same issue,I have export JAVA_HOME ,but none works

kiawin commented 6 years ago

For ubuntu, it would be like this

$ apt-get install openjdk-8-jdk
$ export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
$ cmake .

I obtained the path of jdk from the following command

dpkg-query -L openjdk-8-jdk
mu2 commented 5 years ago

this is not working on cmake version 2.8.12.2

Liron24 commented 5 years ago

Same issue for me as well. I set the path but still gets:

-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error: your C compiler: "CMAKE_C_COMPILER-NOTFOUND" was not found.   Please set CMAKE_C_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
jrudolph commented 5 years ago

Do you have any compilers installed? On which platform did you try?

Liron24 commented 5 years ago

@jrudolph I see I have some compilers install, not sure about it though (python, ruby,vim). What's the recommended compiler to be installed? I'm running on Centos 7

jrudolph commented 5 years ago

You'll need gcc at least. Don't know about Centos but this stackoverflow answer seems useful. So maybe

yum install gcc-c++

might be enough?

sayyedahmadmousavi commented 5 years ago

For ubuntu, it would be like this

$ apt-get install openjdk-8-jdk
$ export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
$ cmake .

I obtained the path of jdk from the following command

dpkg-query -L openjdk-8-jdk

it works for me,but it happends many times

vans8800 commented 5 years ago

推荐阅读以下链接: https://ieevee.com/tech/2016/07/20/hadoop-mvn.html

amastrobera commented 5 years ago

I had the same error doing cmake, afterhaving installed with sudo apt-get install -y openjdk-8-jdk. I solved the problem with:

  1. installing the additional sudo apt-get install -y default-jdk
  2. setting export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64"
ZiluTian commented 5 years ago

For centos 7, I was able to solve it by installing the devel kit (java-1.8.0-openjdk-devel.x86_64) in addition to openjdk (java-1.8.0-openjdk).

vanga commented 4 years ago

I am getting the same error, I have JDK 11 installed, does this work with 11? I have CMAKE 2.8.12

CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
  Could NOT find Java (missing: Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE
  Java_JAVAH_EXECUTABLE Java_JAVADOC_EXECUTABLE) (found version "11.0.5")
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake/Modules/FindJava.cmake:191 (find_package_handle_standard_args)
  CMakeLists.txt:23 (find_package)

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
JAVA_INCLUDE_PATH (ADVANCED)
   used as include directory in directory /home/ec2-user/perf-map-agent
JAVA_INCLUDE_PATH2 (ADVANCED)
   used as include directory in directory /home/ec2-user/perf-map-agent
vanga commented 4 years ago

turns out I need cmake3, it works with this version of cmake. Thanks.