我是Linux新手,正在VM上工作。我正在尝试配置我的JMagick
安装,但是当我运行./configure
时,我收到一个错误,说它是"无法找到Java目录:"
./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for a BSD-compatible install... /usr/bin/install -c
checking for getconf... /usr/bin/getconf
checking whether large file support needs explicit enabling... no
checking for X... libraries , headers
configure: error: 'Unable to locate Java directories'
我知道configure
正在寻找java
, javac
, jar
和gcc
。当我在每个项目上输入whereis
时,我看到它们都在/usr/bin
中的$PATH
上(我甚至单独添加了每个路径):
PATH=/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/bin/java:/usr/bin/javac:/usr/bin/jar:/usr/bin/gcc
whereis java javac jar gcc
java: /usr/bin/java /etc/java /usr/lib/java /usr/share/java /usr/share/man/man1/java.1.gz
javac: /usr/bin/javac /usr/share/man/man1/javac.1.gz
jar: /usr/bin/jar /usr/share/man/man1/jar.1.gz
gcc: /usr/bin/gcc /usr/lib/gcc /usr/libexec/gcc /usr/share/man/man1/gcc.1.gz
从我所能找到的,我相信我需要设置一个JAVA_HOME
环境变量。所以我做了:
JAVA_HOME=/usr/bin/java
尽管如此,我仍然得到Unable to locate Java directories
错误。正如我所说的,我是Linux的新手,我很困惑,不知道该怎么做。你知道我做错了什么吗?
如果是相关的,VM上运行的各种技术的当前版本是:
java version "1.7.0_09-icedtea"
OpenJDK Runtime Environment (rhel-2.3.4.1.el6_3-x86_64)
OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
javac 1.7.0_09
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3)
-
yum install java-1.6.0-openjdk java-1.6.0-openjdk-devel
-
tar zxvf Jmagick.xx.xx
-
cd
the dir -
./configure --prefix=/usr/local/imagemagick/ -with-java-home=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.38.x86_64/
JMagick需要安装jdk1.6,试试这个:
yum install java-1.6.0-openjdk java-1.6.0-openjdk-devel