cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
john_bld
Level 3

Check RedHat or Ubuntu and also check Java version

Hi,

I want to install Java through Installer. So I have to first check the version of java in the system. If it have older version than 1.6, then I have to install java on the system.

Also I have to check whether the system is RedHat or ubuntu.. Is there a variable to use to check these.

I looked at $prop.os.name$ variable. But it only verifys the systems OS.

Thanks in advance
Labels (1)
0 Kudos
(7) Replies
pv7721
Level 20

If /etc/redhat-release exists and if grep RedHat /etc/redhat-release is not-null I say there is pretty much the chance to be a RedHat system. I guess there should be a similar thing for Debian.
0 Kudos
james_decosta
Level 9

hi,
you can check the version of java on the system
by finding $prop.java.vm.version$ which will tell you the version of java
Then if you want to install java other than the version already installed on the machine you can.....
By the way are you running java installer for installing java or you are bundling the jdk and setting it as JAVA_HOME and appending it to the PATH variable.
You can add the rule on your java installer as install only if
$prop.java.vm.version$ does not equal 1.6
Regards ,
james.
0 Kudos
james_decosta
Level 9

hi,
i also use these type of workarounds like checking for a file or folder and stopping till some property in the file is set to true.
I want to know whether these actions which i perform for tasks which are not supported by installanywhere are genuine or there will be loopholes and they will fail some day.
Regards,
james.
0 Kudos
john_bld
Level 3

Actually my installer, install some code. In order for that code to run, it needs java 1.6. If not it fails. Thatswhy I want to install java on the system.

Thanks for your reply.

I will incorparate the ideas in my installer
0 Kudos
purcellk24
Level 7

The $prop.java.vm.version$ only tells you what version of Java you are using for the installer. It doesn't tell you what versions are installed.

You can always bundle the 1.6 jre with your installer and then you have a private jre installed that your code can use. This way you are always assured of what version of Java you are executing.
0 Kudos
john_bld
Level 3

I didn't understand you answer. Can you please explain clearly.
Actually I wrote my own script to check the java version and also redhat or ubuntu. Now I am having different issue.

I am trying to install "jre-6u6-linux-i586.bin" through the installer. Because the customer needs it. I have my own script to install the jre. I am using the execute target file action to run this script. And the installer runs the script. But this bin file shows the license agreement on the command line where I have to say yes or no. But because installer is running I am not able to see the license and it never installs anything.

Can anyone provide me any ideas
0 Kudos
pv7721
Level 20

It seems that you're not aware that usually, in order for the installed applications to work, IA has the capability to install a JRE for the sole use of the respective application. You can download a VM pack from here: http://acresso.com/downloads/VMpacks/SunJRE160_00LinuxINTEL.vm or if this version doesn't suit you, you can make your own VM pack following the instructions fromthis KB article: http://kb.acresso.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=Q000195&sliceId=
0 Kudos