2

我是 Linux 新手,正在使用虚拟机。我正在尝试配置我的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,jargcc. 当我whereis在这些项目中的每一个上键入时,我发现它们都在我$PATH的输入中/usr/bin(我什至将每个项目单独添加到路径中):

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)
4

2 回答 2

1
  1. yum install java-1.6.0-openjdk java-1.6.0-openjdk-devel
  2. tar zxvf Jmagick.xx.xx
  3. cd目录
  4. ./configure --prefix=/usr/local/imagemagick/ -with-java-home=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.38.x86_64/
  5. 完毕
于 2016-04-20T21:43:21.090 回答
-2

JMagick 需要安装 jdk1.6,试试这个:

yum install java-1.6.0-openjdk java-1.6.0-openjdk-devel
于 2016-04-19T07:00:50.023 回答