You are not logged in.

#1 2014-11-09 22:14:05

SanskritFritz
Member
From: Budapest, Hungary
Registered: 2009-01-08
Posts: 1,954
Website

[Solved] How do I find out $JAVA_HOME or similar?

I want to compile
https://aur.archlinux.org/packages/areca-beta/
There is a line in build():

CPATH=$CPATH:$JAVA_HOME/include:$JAVA_HOME/include/linux ant -buildfile build.xml

but $JAVA_HOME is not set anymore. Still I need the location of $JAVA_HOME/include so I can compile jni.
How can I find out the location of jni.h?

Last edited by SanskritFritz (2014-11-10 18:03:38)


zʇıɹɟʇıɹʞsuɐs AUR || Cycling in Budapest with a helmet camera || Revised log levels proposal: "FYI" "WTF" and "OMG" (John Barnette)

Offline

#2 2014-11-09 22:45:50

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved] How do I find out $JAVA_HOME or similar?

I'm not sure I understand, have you tried exporting JAVA_HOME or setting it in the PKGBUILD?

$ pkgfile -v jni.h
extra/jdk7-openjdk 7.u71_2.5.3-1        /usr/lib/jvm/java-7-openjdk/include/jni.h
extra/jdk8-openjdk 8.u25-1              /usr/lib/jvm/java-8-openjdk/include/jni.h
community/classpath 0.98-7              /usr/include/jni.h

Offline

#3 2014-11-10 16:46:44

SanskritFritz
Member
From: Budapest, Hungary
Registered: 2009-01-08
Posts: 1,954
Website

Re: [Solved] How do I find out $JAVA_HOME or similar?

Well, the line I quoted from the areca-beta PKGBUILD assumes $JAVA_HOME is set and this was the case until the recent Java upgrade. Now I have to find a way to determine JAVA_HOME, but I don't know how. (the PKGBUILD has to set $CPATH for the compiler in order to be able to include jni.h).

So in a nutshell, all I want to know, how can I determine the path which was formerly set in $JAVA_HOME.


zʇıɹɟʇıɹʞsuɐs AUR || Cycling in Budapest with a helmet camera || Revised log levels proposal: "FYI" "WTF" and "OMG" (John Barnette)

Offline

#4 2014-11-10 17:22:39

SanskritFritz
Member
From: Budapest, Hungary
Registered: 2009-01-08
Posts: 1,954
Website

Re: [Solved] How do I find out $JAVA_HOME or similar?

What I found so far are:

> whereis java
java: /usr/bin/java /usr/share/java /usr/lib/jvm/java-7-openjdk/bin/java /usr/share/man/man1/java.1.gz

> readlink $(which java)
/usr/lib/jvm/default-runtime/bin/java

Or one can simply use

/usr/lib/jvm/default

Which one should I use? OR what is the canonical way for determining where my default java home dir is?


zʇıɹɟʇıɹʞsuɐs AUR || Cycling in Budapest with a helmet camera || Revised log levels proposal: "FYI" "WTF" and "OMG" (John Barnette)

Offline

#5 2014-11-10 18:02:56

SanskritFritz
Member
From: Budapest, Hungary
Registered: 2009-01-08
Posts: 1,954
Website

Re: [Solved] How do I find out $JAVA_HOME or similar?

Ok, I should have read the wiki more carefully, especially this part:
https://wiki.archlinux.org/index.php/Ja … linux-java

This actually gave me the answer to my question. According to the wiki as a packager I can expect any package providing java-environment to be installed in /usr/lib/jvm/ and providing the link /usr/lib/jvm/default.


zʇıɹɟʇıɹʞsuɐs AUR || Cycling in Budapest with a helmet camera || Revised log levels proposal: "FYI" "WTF" and "OMG" (John Barnette)

Offline

#6 2014-11-10 19:20:41

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved] How do I find out $JAVA_HOME or similar?

SanskritFritz wrote:

Ok, I should have read the wiki more carefully

That's why I was confused :-)

Offline

#7 2014-11-10 20:49:54

SanskritFritz
Member
From: Budapest, Hungary
Registered: 2009-01-08
Posts: 1,954
Website

Re: [Solved] How do I find out $JAVA_HOME or similar?

karol wrote:
SanskritFritz wrote:

Ok, I should have read the wiki more carefully

That's why I was confused :-)

Oh come on, don't be so picky tongue


zʇıɹɟʇıɹʞsuɐs AUR || Cycling in Budapest with a helmet camera || Revised log levels proposal: "FYI" "WTF" and "OMG" (John Barnette)

Offline

Board footer

Powered by FluxBB