Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004823 [Resin] minor always 10-24-11 16:19 10-27-11 14:27
Reporter rickHigh View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version
Summary 0004823: Resin does not compile easily on Amazon Linux AMI
Description Amazon has their own version of CentOS for Amazon AWS EC2.

This version uses their own Yum repository.

The Java SDK (OpenJDK 1.6) is missing the jni.h header files that Resin needs to compile the JNI C modules for faster HTTP handling.

In general there seems to be more issues compiling on CentOS than Debian derivatives.
It seems we really need a rpm package with some install instructions for it.
Additional Information
Attached Files

- Relationships

- Notes
10-24-11 16:23

To get Resin to compile at all you need this command:

sudo yum groupinstall "Development Tools"

This installs all of the dev tools like C compiler.

It still fails to find the JNI libs....

configure: error:

    *** Can't find JNI directory in JAVA_HOME=/usr/lib/jvm/jre
    *** JNI is expected in /usr/lib/jvm/jre/include/linux

I ran into this same issue with CentOS 4.5 a few weeks ago when trying to track down a CentOS compile issue.

Amazon Linux is CentOS.... [^]
10-25-11 00:28

This seem to do the trick for getting the header....

sudo yum install java-1.6.0-openjdk-devel.x86_64

$ pwd
[ec2-user@ip-10-124-214-37 jvm]$ find . -name "*.h"

To get the gcc compiler...

sudo yum groupinstall 'Development Tools'

I was still getting compile error....

configure: error:

    *** Can't find JNI directory in JAVA_HOME=/usr/lib/jvm/jre
    *** JNI is expected in /usr/lib/jvm/jre/include/linux
$ export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-

This got me past that issue.

I changed it to 64 bit (not sure why this is not the default on a 64 bit OS)

$ ./configure --enable-64bit

OpenSSL support not enabled at this point.

That seemed to work.
10-27-11 00:50

Even when you install the right obscure package that has the headers. The build does not work without manually setting JAVA_HOME which does not work for rpmbuild to build rpm files as you can't rely on manually setting JAVA_HOME.
10-27-11 00:53

To get rpmbuild to work with creating a resin rpm, I needed to set the following...

sudo ln -s /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin /usr/lib/jvm/bin

somehow the build expects java to be in /usr/lib/jvm/bin and it is not for Amazon WS and CentOS.
10-27-11 00:57

Now I am getting this from rpmbuild. It seems like he resets the JAVA_HOME

checking if /bin/cp accepts -u... yes
configure: error:

    *** Can't find JNI directory in JAVA_HOME=/usr/lib/jvm
    *** JNI is expected in /usr/lib/jvm/include/linux
error: Bad exit status from /var/tmp/rpm-tmp.sotT7x (%build)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.sotT7x (%build)
[ec2-user@domU-12-31-38-04-B2-A3 resin-rpm]$ echo $JAVA_HOME
10-27-11 01:02

[ec2-user@domU-12-31-38-04-B2-A3 resin-rpm]$ sudo mv /usr/lib/jvm /usr/lib/java-libs
[ec2-user@domU-12-31-38-04-B2-A3 resin-rpm]$ sudo ln -s /usr/lib/java-libs/java-1.6.0-openjdk.x86_64/ /usr/lib/jvm

[ec2-user@domU-12-31-38-04-B2-A3 resin-rpm]$ export JAVA_HOME=/usr/lib/jvm

Now the rpmbuild fails with...

[ec2-user@domU-12-31-38-04-B2-A3 resin-rpm]$ sudo rpmbuild -v -bb --clean SPECS/resin.spec

checking sys/epoll.h presence... yes
checking for sys/epoll.h... yes
checking for JAVA_HOME...
configure: error: Can't find valid JAVA_HOME
error: Bad exit status from /var/tmp/rpm-tmp.Z9fgLH (%build)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.Z9fgLH (%build)

- Issue History
Date Modified Username Field Change
10-24-11 16:19 rickHigh New Issue
10-24-11 16:23 rickHigh Note Added: 0005580
10-25-11 00:28 rickHigh Note Added: 0005582
10-27-11 00:50 rickHigh Note Added: 0005584
10-27-11 00:53 rickHigh Note Added: 0005585
10-27-11 00:57 rickHigh Note Added: 0005586
10-27-11 01:02 rickHigh Note Added: 0005587
10-27-11 14:27 ferg Assigned To  => ferg
10-27-11 14:27 ferg Status new => closed
10-27-11 14:27 ferg Resolution open => fixed
10-27-11 14:27 ferg Fixed in Version  => 4.0.24

Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
39 total queries executed.
31 unique queries executed.
Powered by Mantis Bugtracker