Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake error(cmake version is 2.8.12.2) #53

Open
liuluo129 opened this issue May 5, 2017 · 14 comments
Open

cmake error(cmake version is 2.8.12.2) #53

liuluo129 opened this issue May 5, 2017 · 14 comments

Comments

@liuluo129
Copy link

liuluo129 commented May 5, 2017

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
Copy link

alex-dukhno commented Jun 19, 2017

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
Copy link

yqf1991 commented Jan 19, 2018

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

@kiawin
Copy link

kiawin commented Mar 29, 2018

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
Copy link

mu2 commented Dec 4, 2018

this is not working on cmake version 2.8.12.2

@Liron24
Copy link

Liron24 commented Dec 11, 2018

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
Copy link
Member

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

@Liron24
Copy link

Liron24 commented Dec 11, 2018

@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
Copy link
Member

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
Copy link

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
Copy link

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

@amastrobera
Copy link

amastrobera commented May 14, 2019

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
Copy link

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
Copy link

vanga commented Apr 6, 2020

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
Copy link

vanga commented Apr 6, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests