How to Find JRE installed in linux machine..? | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

How to Find JRE installed in linux machine..?

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 10-10-2007
XivaX XivaX is offline
Registered User
 
Join Date: Oct 2007
Last Activity: 10 October 2007, 8:21 AM EDT
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
How to Find JRE installed in linux machine..?

Hi all,

Im new to linux... Im in need to write a shell script to check wthr JRE in linux machine... Wtz de best way to find thru BASH?? Plz help me out to solve this issue...

Thanks
Sponsored Links
    #2  
Old 10-10-2007
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
AFK
 
Join Date: Dec 2004
Last Activity: 28 July 2014, 9:39 AM EDT
Location: UK
Posts: 2,351
Thanks: 0
Thanked 6 Times in 6 Posts
By JRE, do you mean a basic java install? That can be checked by running 'which java'. If it is in the path, it will show up. Other ways include running a find on / and looking for the file with your name. That will be slow, though.
Sponsored Links
    #3  
Old 10-10-2007
vino's Avatar
vino vino is offline Forum Advisor  
Supporter (in vino veritas)
 
Join Date: Feb 2005
Last Activity: 9 April 2013, 8:19 AM EDT
Location: Sydney, Down Under
Posts: 2,847
Thanks: 0
Thanked 12 Times in 12 Posts
Unlike Windows, there is no standard way to find out if java is installed on your machine unless ofcourse /usr/bin/java points to GNU java or the SUN java.

You can, at best, look into the environment variables LD_LIBRARY_PATH and PATH to see whether you have a JAVA related path in those env variables.
    #4  
Old 01-31-2008
ionutned ionutned is offline
Registered User
 
Join Date: Jan 2008
Last Activity: 31 January 2008, 8:18 PM EST
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Unfortunately a solution like "which java" doesn't always work. For instance, I need to find the JRE location not for the binary "java", but for the library libjvm.so, because I want to launch a JVM from C native code.
The library path is something like this: "<JAVA_HOME>/jre/lib/i386/client/libjvm.so, and because of all symbolic links, if I get a path like /usr/bin/java using "which", it doesn't help me much.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
What time did Ubuntu installed on machine? getrue Ubuntu 4 08-01-2011 09:01 AM
How do I network a Suse installed machine with other computers, specifically Red hat Linux? Anna Hussie Red Hat 1 05-19-2011 01:55 AM
Launching X apps from a machine without X installed flj Linux 4 05-14-2010 10:27 AM
Findout iLO type installed in a machine skmdu Linux 1 09-25-2009 04:38 AM
command to find when Linux OS is installed? crackthehit007 UNIX for Advanced & Expert Users 2 04-13-2009 04:44 PM



All times are GMT -4. The time now is 08:40 PM.