Version of Jdk on my machine | Unix Linux Forums | UNIX and Linux Applications

  Go Back    


UNIX and Linux Applications Discuss UNIX and Linux software applications. This includes SQL, Databases, Middleware, MOM, SOA, EDA, CEP, BI, BPM and similar topics.

Version of Jdk on my machine

UNIX and Linux Applications


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 10-09-2012
chercheur857 chercheur857 is offline
Banned
 
Join Date: Mar 2012
Last Activity: 2 June 2014, 6:52 AM EDT
Posts: 98
Thanks: 49
Thanked 1 Time in 1 Post
Version of Jdk on my machine

Hello,

Please, i ask what command linux used to know the version of jdk installed on my machine ?


Thank you so much.
Sponsored Links
    #2  
Old 10-09-2012
itkamaraj's Avatar
itkamaraj itkamaraj is offline Forum Advisor  
^Kamaraj^
 
Join Date: Apr 2010
Last Activity: 3 October 2014, 8:50 AM EDT
Posts: 3,059
Thanks: 33
Thanked 659 Times in 638 Posts

Code:
 
java -version

The Following User Says Thank You to itkamaraj For This Useful Post:
chercheur857 (10-09-2012)
Sponsored Links
    #3  
Old 10-09-2012
chercheur857 chercheur857 is offline
Banned
 
Join Date: Mar 2012
Last Activity: 2 June 2014, 6:52 AM EDT
Posts: 98
Thanks: 49
Thanked 1 Time in 1 Post
Quote:
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.13) (6b20-1.9.13-0ubuntu1~10.10.1)
OpenJDK Client VM (build 19.0-b09, mixed mode, sharing)
I have a question please about jdk, i have used in my code the function renameTo in my code java,
I ask please is that possible that a function in java operates correctly with a version of jdk and not with others (exp openjdk-6-jdk ) ?

Last edited by chercheur857; 10-09-2012 at 07:51 AM..
    #4  
Old 10-09-2012
itkamaraj's Avatar
itkamaraj itkamaraj is offline Forum Advisor  
^Kamaraj^
 
Join Date: Apr 2010
Last Activity: 3 October 2014, 8:50 AM EDT
Posts: 3,059
Thanks: 33
Thanked 659 Times in 638 Posts
you can get the java version using the below code


Code:
String version = System.getProperty("java.version");

then compare the version with your expected version, then do the rename
Sponsored Links
    #5  
Old 10-09-2012
chercheur857 chercheur857 is offline
Banned
 
Join Date: Mar 2012
Last Activity: 2 June 2014, 6:52 AM EDT
Posts: 98
Thanks: 49
Thanked 1 Time in 1 Post
i have added this instruction to my code:
The version is 1.6.0_20
with this version of jdk the renameTo works well
but with openjdk-6 not
how can i do please ?
see this url please: http://docs.oracle.com/javase/7/docs...ava.io.File%29
Sponsored Links
    #6  
Old 10-09-2012
itkamaraj's Avatar
itkamaraj itkamaraj is offline Forum Advisor  
^Kamaraj^
 
Join Date: Apr 2010
Last Activity: 3 October 2014, 8:50 AM EDT
Posts: 3,059
Thanks: 33
Thanked 659 Times in 638 Posts
can you explain more of the below line

but with openjdk-6 not
Sponsored Links
    #7  
Old 10-09-2012
chercheur857 chercheur857 is offline
Banned
 
Join Date: Mar 2012
Last Activity: 2 June 2014, 6:52 AM EDT
Posts: 98
Thanks: 49
Thanked 1 Time in 1 Post
the same code run correctly on a machine with jdk: java version "1.6.0_20" OpenJDK Runtime Environment (IcedTea6 1.9.13) (6b20-1.9.13-0ubuntu1~10.10.1) OpenJDK Client VM (build 19.0-b09, mixed mode, sharing) but with other machine with jdk openjdk-6-jdk does not work :::

At run time the program does not rename the file (it does not moving the file).. i have an error when the programm will use the file in the new destination (when i insert command linux mv in my code java it works !!!)
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
How to transfer files from unix machine to local machine using shell script? vidhyaS Shell Programming and Scripting 1 08-08-2011 10:27 AM
shell script to copy files frm a linux machine to a windows machine using SCP nithin6034 Shell Programming and Scripting 3 07-21-2011 12:56 AM
is there an veritas volume manager version compatible with solaris x86 machine? chidori Solaris 2 06-12-2011 09:02 PM
To find the LATEST file from a dir on REMOTE machine and SCP to local machine? me_ub Red Hat 3 07-08-2009 12:57 AM
Best possible communication mechanism between a Solaris machine and a windows machine Krsh Solaris 7 02-05-2009 09:41 AM



All times are GMT -4. The time now is 07:08 AM.