octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: java and Ubuntu 12


From: Ben Abbott
Subject: Re: java and Ubuntu 12
Date: Mon, 26 Nov 2012 16:20:13 -0500

On Nov 26, 2012, at 3:08 PM, Ben Abbott wrote:

> On Nov 26, 2012, at 2:50 PM, Daniel J Sebald wrote:
> 
>> On 11/26/2012 01:31 PM, Benjamin Abbott wrote:
>> 
>>> On Nov 26, 2012, at 2:13 PM, Ben Abbott<address@hidden>  wrote:
>>> 
>>>> On Nov 26, 2012, at 1:02 PM, Alexander Hansen wrote:
>>>> 
>>>>> On 11/26/12 10:48 AM, Daniel J Sebald wrote:
>>>>> 
>>>>>> On 11/26/2012 11:09 AM, Ben Abbott wrote:
>>>>>>> 
>>>>>>> On Nov 26, 2012, at 11:29 AM, Michael D. Godfrey wrote:
>>>>>>> 
>>>>>>>> On 11/26/12 4:16 PM, Ben Abbott wrote:
>>>>>>>>> OpenJDK Java 7 Runtime
>>>>>>>> I think you need the devel package from:
>>>>>>>> 
>>>>>>>>   Debian, Ubuntu, /etc./
>>>>>>>> 
>>>>>>>> On the command line, type:
>>>>>>>> 
>>>>>>>> *$* sudo apt-get install openjdk-7-jre
>>>>>>>> 
>>>>>>>> The |openjdk-7-jre| package contains just the Java Runtime
>>>>>>>> Environment. If you want to develop Java programs then install the
>>>>>>>> |openjdk-7-jdk| package.
>>>>>>>> 
>>>>>>>> These names do not quite match what you said, but something with
>>>>>>>> -jdk or -devel is where the headers are.
>>>>>>>> 
>>>>>>>> Michael'
>>>>>>> 
>>>>>>> I already have all the openjdk-7 packages installed.
>>>>>>> 
>>>>>>> $ apt-cache pkgnames | grep jdk-7
>>>>>>> openjdk-7-jre-headless
>>>>>>> openjdk-7-source
>>>>>>> openjdk-7-jre-zero
>>>>>>> openjdk-7-demo
>>>>>>> openjdk-7-dbg
>>>>>>> openjdk-7-doc
>>>>>>> openjdk-7-jdk
>>>>>>> openjdk-7-jre
>>>>>>> openjdk-7-jre-lib
>>>>>>> 
>>>>>>> $ apt-cache --installed pkgnames | grep jdk-7
>>>>>>> openjdk-7-jre-headless
>>>>>>> openjdk-7-source
>>>>>>> openjdk-7-jre-zero
>>>>>>> openjdk-7-demo
>>>>>>> openjdk-7-dbg
>>>>>>> openjdk-7-doc
>>>>>>> openjdk-7-jdk
>>>>>>> openjdk-7-jre
>>>>>>> openjdk-7-jre-lib
>>>>>>> 
>>>>>>> Ben
>>>>>> 
>>>>>> Those are all runtime environment files.  The Octave java tools need the
>>>>>> "development kit" or JDK part of things, i.e., the part that creates the
>>>>>> byte code that can run within the JRE.  Look for the RPM (or whatever is
>>>>>> the equivalent) with openjdk Development Kit.
>>>>>> 
>>>>>> Dan
>>>>> 
>>>>> I'm seeing "openjdk-7-jdk" in Ben's list, and searching the online file
>>>>> database rather than my local machine, I found the following:
>>>>> 
>>>>> $ apt-file find jni.h
>>>>> ...
>>>>> openjdk-7-jdk: /usr/lib/jvm/java-7-openjdk-amd64/include/jni.h
>>>>> 
>>>>> So it's probably just a matter of setting paths appropriately.
>>>> 
>>>> I didn't know about apt-file.  That's a nice feature.
>>>> 
>>>>   $ apt-file find jni.h | grep jdk-7
>>>>   openjdk-7-jdk: /usr/lib/jvm/java-7-openjdk-i386/include/jni.h
>>>> 
>>>> With ...
>>>> 
>>>>   export JAVA_CPPFLAGS=/usr/lib/jvm/java-7-openjdk-i386/include
>>>>   export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386/bin
>>>> 
>>>> My build still fails.  My Makefile contains ...
>>>> 
>>>>   JAR =
>>>>   JAVA = /usr/bin/java
>>>>   JAVAC =
>>>>   JAVA_CPPFLAGS = -I/usr/lib/jvm/java-7-openjdk-i386/include
>>>>   JAVA_LIBS =
>>>> 
>>>> Suggestions?
>>> 
>>> Forgot to mention, my build still fails with the same error.
>>> 
>>>>   dldfcn/__java__.h:25:17: fatal error: jni.h: No such file or directory
>>>>   compilation terminated.
>> 
>> Is jni.h on your system somewhere?
>> 
>> The JAR and JAVAC were initially undefined for me.  (It was only after half 
>> an hour of compiling that I realized those were necessary.)  After 
>> installing the JDK development environment, running "configure" creates a 
>> proper JAR and JAVAC definition.
>> 
>> Dan
> 
> Hmmm .... I have the Java development kit installed
> 
>       $ apt-cache --installed pkgnames | grep openjdk-7-jdk
>       openjdk-7-jdk
> 
> It *should* include jni.h ...
> 
>       $ apt-file find jni.h | grep jdk-7
>       openjdk-7-jdk: /usr/lib/jvm/java-7-openjdk-i386/include/jni.h
> 
> But the include directory does not exist.
> 
>       $ ls /usr/lib/jvm/java-7-openjdk-i386
>       bin  docs  jre  man
> 
> I tried to locate jni.h using find, but nothing was returned.
> 
>       find /usr -name jni.h
> 
> Perhaps the openjdk-7-jdk package is broken (?).  So I tried ...
> 
> $ sudo apt-get install openjdk-7-jdk
> [sudo] password for bpabbott: 
> Reading package lists... Done
> Building dependency tree       
> Reading state information... Done
> The following extra packages will be installed:
>  libxt-dev
> Suggested packages:
>  libxt-doc openjdk-7-demo openjdk-7-source visualvm
> The following NEW packages will be installed:
>  libxt-dev openjdk-7-jdk
> 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
> Need to get 17.1 MB of archives.
> After this operation, 21.8 MB of additional disk space will be used.
> Do you want to continue [Y/n]? 
> 
> Now the jni.h is where it belongs!
> 
> $ ls /usr/lib/jvm/java-7-openjdk-i386/include
> classfile_constants.h  jawt.h  jawt_md.h  jdwpTransport.h  jni.h  jni_md.h  
> jvmticmlr.h  jvmti.h  linux
> 
> I'll report back when my build completes.
> 
> Ben

My build completed.

        export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386
        ./configure
        make -j2

Ben



reply via email to

[Prev in Thread] Current Thread [Next in Thread]