Ghidra JDK home directory issue

I downloaded Ghidra from here

wget https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra_10.1.1_build/ghidra_10.1.1_PUBLIC_20211221.zip 

Extract it

7z x ghidra_10.1.1_PUBLIC_20211221.zip 

Change directory

cd ghidra_10.1.1_PUBLIC 

List directory

$ ls -lh total 48K drwxr-xr-x 5 user user 4.0K Dec 21 13:41 docs drwxr-xr-x 5 user user 4.0K Dec 21 13:41 Extensions drwxr-xr-x 9 user user 4.0K Dec 21 13:41 Ghidra -rwxr-xr-x 1 user user 883 Dec 21 13:41 ghidraRun -rw-r--r-- 1 user user 344 Dec 21 13:41 ghidraRun.bat drwxr-xr-x 6 user user 4.0K Dec 21 13:41 GPL -rw-r--r-- 1 user user 12K Dec 21 13:41 LICENSE drwxr-xr-x 2 user user 4.0K Dec 21 13:41 licenses drwxr-xr-x 2 user user 4.0K Dec 21 13:41 server drwxr-xr-x 2 user user 4.0K Dec 21 13:41 support 

Run the binary, but need to specify JDK path

$ ./ghidraRun Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true ****************************************************************** JDK 11+ (64-bit) could not be found and must be manually chosen! ****************************************************************** Enter path to JDK home directory (ENTER for dialog): 

So, I checked Java version

$ java --version Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true openjdk 11.0.12 2021-07-20 OpenJDK Runtime Environment (build 11.0.12+7-post-Debian-2) OpenJDK 64-Bit Server VM (build 11.0.12+7-post-Debian-2, mixed mode, sharing) 

I also checked java path

$ which java /usr/bin/java 

And it's realpath

$ realpath /usr/bin/java /usr/lib/jvm/java-11-openjdk-amd64/bin/java 

However, when I put the directory, I'm getting the following error

$ ./ghidraRun Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true ****************************************************************** JDK 11+ (64-bit) could not be found and must be manually chosen! ****************************************************************** Enter path to JDK home directory (ENTER for dialog): /usr/lib/jvm/java-11-ope Not a valid JDK home directory. Not a directory! Enter path to JDK home directory (ENTER for dialog): /usr/lib/jvm/java-11-ope Not a valid JDK home directory. Missing bin directory! Enter path to JDK home directory (ENTER for dialog): /usr/lib/jvm/java-11-ope Not a valid JDK home directory. JDK is missing javac executable! Enter path to JDK home directory (ENTER for dialog): 

What's wrong in this case? What should I do to fix it?

submitted by /u/w0lfcat
[link] [comments]

from hacking: security in practice https://ift.tt/3qSw4tn

Comments