2

I am new to Linux and am working on a VM. I am trying to configure my JMagick installation, however when I run ./configure I receive an error saying that it is 'Unable to locate Java directories:'

./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'

I know that the configure is looking for java, javac, jar, and gcc. When I type whereis on each of these items I see that they are all on my $PATH in /usr/bin (I even added each to the path individually):

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

From what I was able to find, I believe I need to set a JAVA_HOME environmental variable. So I did:

JAVA_HOME=/usr/bin/java

Nevertheless, I still get the Unable to locate Java directories error. As I said I am new to Linux and am pretty stuck and unsure about what to do. Any ideas as to what I am doing incorrectly?

If it is at all relevant, the current versions of the various technologies running on the VM are:

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)

2 Answers2

1
  1. yum install java-1.6.0-openjdk java-1.6.0-openjdk-devel
  2. tar zxvf Jmagick.xx.xx
  3. cd the dir
  4. ./configure --prefix=/usr/local/imagemagick/ -with-java-home=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.38.x86_64/
  5. done
Benjamin W.
  • 46,058
  • 19
  • 106
  • 116
cpsing
  • 49
  • 1
-2

JMagick requires installing jdk1.6, try this:

yum install java-1.6.0-openjdk java-1.6.0-openjdk-devel
Undo
  • 25,519
  • 37
  • 106
  • 129
cpsing
  • 49
  • 1
  • 1
    This does not provide an answer to the question. Once you have sufficient [reputation](http://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](http://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](http://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/low-quality-posts/12066245) – Bono Apr 19 '16 at 07:24
  • 1. yum install java-1.6.0-openjdk java-1.6.0-openjdk-devel; – cpsing Apr 20 '16 at 21:41