2

I'm trying to setup Android development with Eclipse (Indigo), on Fedora17. Almost everything seems to work, just the javah is missing, to build the C headers with, for native (NDK / JNI) modules.

On my windows install of the tool chain it was in the same folder javac was in, but this is not the case on the Linux machine.

I previously installed Oracle's JDK1.7, found out that it's to new for something else I wanted to do (but also there, no javah), uninstalled it, now JDK1.6 is installed.

What might be wrong?

user1847129
  • 1,010
  • 2
  • 9
  • 21
  • I don't think java is missing. Type in terminal `java` and `javac` to verify whether the runtime environment and the compiler is missing or not. – Sibi Nov 23 '12 at 10:10
  • No, java and javac are present, but javah is missing. – user1847129 Nov 23 '12 at 10:37
  • Ah sorry, just notices that the original post said "java is missing", corrected that, I meant javah missing - now it's the headline, too?? I'm 100% positive I wrote javah there, was that auto-"corrected" ? – user1847129 Nov 23 '12 at 10:39
  • Edited the main post again - please leave the head line intact, it's *javah* that's missing, not java ! – user1847129 Nov 23 '12 at 10:41
  • did you try to `locate` or `find` it? – njzk2 Nov 23 '12 at 10:42
  • I tried find, it does exist, in /usr/java/jdk1.6.0_37/bin, while, when I call 'whereis javac', or java, for that matter, I am pointed to /usr/bin/, where javah is not. Is it supposed to be that way? If not, what should I do? – user1847129 Nov 23 '12 at 11:03
  • (the question may sound stupid, but I'm a Linux n00b and afraid to do wild things and do damage ;-) ) – user1847129 Nov 23 '12 at 11:16
  • @user1847129 How did u install your java ? what is the output of the `locate javah` command ? – Sibi Nov 27 '12 at 19:26
  • locate found nothing IIRC (not on the machine here). Jdk1.7 I had installed via rpm , since that version was downloadable as such. Later, I installed jdk1.6 with sh And did all that alternatives jazz, as described here: [link](http://www.if-not-true-then-false.com/2010/install-sun-oracle-java-jdk-jre-7-on-fedora-centos-red-hat-rhel/) When jdk1.6 didn't install where the jdk1.6 version of that tutorial told it would and thus the alternatives stuff didn't work, I uninstalled everything and just installed jdk1.6 – user1847129 Nov 28 '12 at 09:20

4 Answers4

2

This tool has been removed from the JDK

https://openjdk.java.net/jeps/313

Ulisses
  • 41
  • 5
1

In linux machines, JavaH is normally located in /usr/bin/javah.

If you try to find this file with locate, it is normally a good idea to run before updatedb, since the database is not updated unless this command is run either by the user or a cron job. You could try finding the file with find / |grep javah

P.S. Sorry to post this as an asnwer. I suppose the corret way to go would have been a comment, but still don't have enough reputation to post a comment

igracia
  • 3,543
  • 1
  • 18
  • 23
0

Try gjavah rather than javah?

Jake
  • 1
0

It turns out that javah link is not created during JDK install. You have to create it manually:

Check where is installed java:

$ ls -l `which java`
lrwxrwxrwx root root 26 15 juil. 02:05 /usr/bin/java -> /usr/java/default/bin/java

Create the symlink in the same directory:

$ su
# cd /usr/bin
# ln -s /usr/java/default/bin/javah
Matthieu
  • 2,736
  • 4
  • 57
  • 87