Open liuluo129 opened 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
I also have the same issue,I have export JAVA_HOME ,but none works
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
this is not working on cmake version 2.8.12.2
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.
Do you have any compilers installed? On which platform did you try?
@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
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?
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
I had the same error doing cmake, afterhaving installed with sudo apt-get install -y openjdk-8-jdk
.
I solved the problem with:
sudo apt-get install -y default-jdk
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64"
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).
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
turns out I need cmake3, it works with this version of cmake. Thanks.
i installed cmake, perf, and cmake version is 2.8.12.2, but failed
CMakeError.log