question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

svrAdmin looks for `javac` unecessarily, breaking on RHEL with -headless JRE

See original GitHub issue

Describe the bug When running ghidra as a server on RHEL 8 or 9 (and presumably others) the -headless JRE (for example, java-11-openjdk-headless is sufficient. However, the svrAdmin tool looks for the javac binary within $JAVA_HOME/bin/ and this package does not include this, as it is only the runtime environment. The binary is included in the -devel package (for example java-11-openjdk-devel which pulls in a bunch of unnecessary (for a server) GUI libraries and related junk. This bloats the environment.

To Reproduce Steps to reproduce the behavior:

  1. Set up a RHEL8 or RHEL9 host (an unsubscribed UBI container is sufficient)
  2. Install the java-11-openjdk-headless package
  3. Unpack the ghidra release artifact & configure server.conf
  4. Attempt to use svrAdmin

Expected behavior svrAdmin should operate as-is with just the JRE, without JDK components.

Screenshots

# note: server is up and operational in this example
[root@REDACTED scratch]# docker container exec -i -t ghidra svrAdmin -list
******************************************************************
JDK 11+ (64-bit) could not be found and must be manually chosen!
******************************************************************
Enter path to JDK home directory: /usr/lib/jvm/jre-11-openjdk
Not a valid JDK home directory. JDK is missing javac executable!

Attachments N/A

Environment (please complete the following information):

  • OS: RHEL 8.6, RHEL 9.0, likely others
  • Java Version: 11.0 (java-11-openjdk-11.0.15.0.10-2.el8_6.src.rpm)
  • Ghidra Version: 10.1.4
  • Ghidra Origin: official GitHub distro

Additional context

  • Workaround available: AWS Corretto 11 RPM distribution as this includes the JDK elements without requiring all the GUI gunk.
  • My containerized server repo can be used to test this behavior, see ghidraSvr-in-a-box commit cc3ddb1 if required. Note that subsequent commits replace the RHEL -headless JRE with Corretto.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
draeathcommented, Jun 29, 2022

Gotcha, I misunderstood.

I can confirm your workaround, looks good. (I did the replacement on line 125 only)

1reaction
ryanmkurtzcommented, Jun 29, 2022

It’s going through launch.sh, which requires a JDK:

https://github.com/NationalSecurityAgency/ghidra/blob/a641dd9d25cdd3630a9f1107b8ff5cca7c8dd135/Ghidra/RuntimeScripts/Linux/support/launch.sh#L125

It’s a trivial fix in theory…just pass -java_home instead of jdk_home. But, splitting things apart enough to do this is a bit more work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

OMSA 9.4.0 web service supports alternative Red Hat ... - Dell
Dell OpenManage Server Administrator (OMSA) embeds Oracle Java Runtime Environment (JRE) to render its web GUI on Linux and Windows.
Read more >
Installing devel package does not update the existing java ...
Description of problem: Missing slave configuration for java-11-openjdk-devel package tooling. Version-Release number of selected component ...
Read more >
Re: [Linux-PowerEdge] srvadmin-jre-9.4.0-3787.15943.el7 ...
So far I made workaround: yum install java-11-openjdk-headless.x86_64 yes you need to remove jre because Nessus will find it and report it: ...
Read more >
java - javac : command not found - Stack Overflow
Worked for me with this command: yum install java-devel.
Read more >
jre-openjdk-headless 19.0.1.u10-3 (x86_64) - Arch Linux
Architecture: x86_64. Repository: Extra. Base Package: java-openjdk. Description: OpenJDK Java 19 headless runtime environment.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found