LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-24-2017, 11:28 AM   #1
Ragnar770
LQ Newbie
 
Registered: Aug 2017
Location: Bulgaria
Distribution: Arch
Posts: 16

Rep: Reputation: Disabled
Question Binary executable can't find Java runtime.


I'm trying to run an executable which runs on java and it returns:

Java Runtime Environment not found.

running "java -version" returns:

openjdk version "1.8.0_144"
OpenJDK Runtime Environment (build 1.8.0_144-b01)
OpenJDK 64-Bit Server VM (build 25.144-b01, mixed mode)

In /usr/lib/jvm I have the following folders:

default
default-runtime
java-7-openjdk
java-8-openjdk
java-9-openjdk

Distro is Arch. Thank you in advance!
 
Old 11-24-2017, 11:52 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 10,896

Rep: Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242
Try
Code:
which java
If it gives you a java binary try
Code:
java -jar /path/to/yourjava.jar
i.e the full path & name of your java app.
 
Old 11-24-2017, 12:10 PM   #3
Ragnar770
LQ Newbie
 
Registered: Aug 2017
Location: Bulgaria
Distribution: Arch
Posts: 16

Original Poster
Rep: Reputation: Disabled
Code:
which java
returned
Code:
/usr/bin/java
And sorry, but I don't quite understand that:
Code:
java -jar /path/to/yourjava.jar
 
Old 11-24-2017, 03:55 PM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 10,896

Rep: Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242
Code:
And sorry, but I don't quite understand that:
Code:

java -jar /path/to/yourjava.jar
I use Geomapapp, which is in java. The (only) way I can start it is
Code:
java -jar /usr/local/bin/GeoMapApp.jar
That's what I meant. Put your path and file in place of mine.
 
Old 11-24-2017, 04:00 PM   #5
Ragnar770
LQ Newbie
 
Registered: Aug 2017
Location: Bulgaria
Distribution: Arch
Posts: 16

Original Poster
Rep: Reputation: Disabled
Ah, yes. The only issue is that it's an executable that you run with
Code:
./filename
and not a regular .jar file
 
Old 11-24-2017, 04:30 PM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 10,896

Rep: Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242
Quote:
Originally Posted by Ragnar770 View Post
Ah, yes. The only issue is that it's an executable that you run with
Code:
./filename
and not a regular .jar file
May I remind you that the name of this thread which you started is "Binary executable can't find Java runtime."?? Now you're telling me how to do it:-o? You mightn't need the .jar extension, but you might need my syntax. Why not try it? Why not run file on it?
Code:
bash-4.3$ file /usr/local/bin/GeoMapApp.jar
/usr/local/bin/GeoMapApp.jar: Zip archive data, at least v2.0 to extract
bash-4.3$ file /bin/bash
/bin/bash: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, stripped
 
Old 11-24-2017, 04:49 PM   #7
Ragnar770
LQ Newbie
 
Registered: Aug 2017
Location: Bulgaria
Distribution: Arch
Posts: 16

Original Poster
Rep: Reputation: Disabled
I did try that. Returs an error for a corrupt or invalid file.
 
Old 11-25-2017, 08:06 AM   #8
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 10,896

Rep: Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242
Running file on it?
 
Old 11-25-2017, 09:09 AM   #9
Ragnar770
LQ Newbie
 
Registered: Aug 2017
Location: Bulgaria
Distribution: Arch
Posts: 16

Original Poster
Rep: Reputation: Disabled
Yes, I did try to start it the way you mentioned but I got the error I posted above.
 
Old 11-25-2017, 09:22 AM   #10
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 10,896

Rep: Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242
Please run file on the things you are trying to run (as I did below) and post the output.
 
Old 11-25-2017, 09:56 AM   #11
Ragnar770
LQ Newbie
 
Registered: Aug 2017
Location: Bulgaria
Distribution: Arch
Posts: 16

Original Poster
Rep: Reputation: Disabled
This was the output:
Code:
ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.4.0, stripped
 
Old 11-25-2017, 02:24 PM   #12
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 10,896

Rep: Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242
This is getting vaguely interesting. That looks like an elf executable, and yet it's bellyaching about java runtime, and as you say should work with ./filename. Yet it doesn't.

Ok, run
Code:
ldd ./filename
and see what it's linked against. That might be loads, but yopu only want the java stuff

Another possibility is that if you run 'filename' instead of './filename', it searches the $PATH variable without searching the current dir. If you type 'echo $PATH' you can see the search order in case you're running something you don't know about.

One last thing you could do is run 'java --version' and see that any java in the system is in the path, and try some other random jar file with 'java -jar random_jar_file'
 
Old 11-25-2017, 03:11 PM   #13
Ragnar770
LQ Newbie
 
Registered: Aug 2017
Location: Bulgaria
Distribution: Arch
Posts: 16

Original Poster
Rep: Reputation: Disabled
This is the output from ldd

Code:
	linux-vdso.so.1 (0x00007ffcc64c8000)
	libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f0b18bcc000)
	libm.so.6 => /usr/lib/libm.so.6 (0x00007f0b18880000)
	libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f0b18662000)
	libc.so.6 => /usr/lib/libc.so.6 (0x00007f0b182aa000)
	/lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007f0b18dd0000)
I can launch Minecraft with
Code:
java -jar path/to/file.jar
and it plays fine.

And yeah, said executable is java based, but I just can't wrap my mind around it since a friend also tried to run it and he didn't have any issues.

Last edited by Ragnar770; 11-25-2017 at 03:12 PM.
 
Old 11-26-2017, 03:47 AM   #14
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,511

Rep: Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006
It probably wants the authentic Oracle java runtime.
 
Old 11-26-2017, 05:28 AM   #15
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 10,896

Rep: Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242
Have you tried
Code:
./filename --help |less
and look out for some option to specify a java location? Is it missing a config file? Has it docs, that say anything about this?

On a separate and irrelevant note, I imagine /lib64 is the proper home of ld-linux-x86-64.so.2. It only matters when files won't run. ldconfig makes symlinks to it (ld-linux.so, ld-linux.so.2) and these may not be present in /lib64. You should check that.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Will changes in Java binary executable affect running Java programs? xuancong Programming 6 04-14-2011 02:04 AM
[SOLVED] Java Woes: A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available ... chytraeus Slackware 10 11-27-2010 11:04 AM
Konqueror message - Cannot find Java executable anilbh Linux - Software 8 03-07-2007 10:18 AM
Runtime binary encryption tools evmccart Linux - Software 1 11-21-2005 06:42 AM
Java SDK won't install, binary file not executable, yoper linux 2.6 kernel lopoetve Linux - Software 8 10-30-2004 04:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration