Script to install jdk | 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.

Script to install jdk

Shell Programming and Scripting


Tags
linux, shell script, shell scripting, unix scripting, unix scripting basics

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 05-09-2008
eamani_sun eamani_sun is offline
Registered User
 
Join Date: May 2008
Last Activity: 14 October 2008, 12:57 PM EDT
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Script to install jdk

Hi,

I need a shell script that would do silent installation of jdk on a linux machine.

Can anyone help me with this?

Thanx
Sunny

Last edited by eamani_sun; 06-12-2008 at 08:48 PM..
Sponsored Links
    #2  
Old 05-09-2008
primp primp is offline
Registered User
 
Join Date: Mar 2008
Last Activity: 22 December 2008, 11:35 PM EST
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
This task is not difficult, you would normally install jdk on linux by doing something like:

./jdk-installer-bin

It'll prompt for you to accept the EULA which just requires "y" along with accepting other defaults.

I would go through the manual process and figure out if you want to use the defaults, come up with an answer file which is just the answer to each question with a newline separating.

Then have a script just do the following:


Code:
#!/bin/sh

./jdk-installer-bin < answer_file

This will provide you with an auto-answer to the installer, I mean you would probably want to check if there's a version that exists/etc. but that's the basic script if you wanted an automated/silent installer.
Sponsored Links
    #3  
Old 05-09-2008
eamani_sun eamani_sun is offline
Registered User
 
Join Date: May 2008
Last Activity: 14 October 2008, 12:57 PM EDT
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for the reply.

But, I have one more question though,the jdk file I am installing has a 'More' command inside it just before the agreement instructions, that way they are making sure that everyone reads the entire agreement.

is there anyway that i can avoid it. I tried to manipulate the file by removing the "more" command from the script. But ,when I reexecute it would say file has been corrupted.

Is there any other way around?

Thanks in advance.

Sundeep
    #4  
Old 05-09-2008
primp primp is offline
Registered User
 
Join Date: Mar 2008
Last Activity: 22 December 2008, 11:35 PM EST
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Last time I checked, it's a general user agreement, once you page down it'll ask if you want to accept. If you pass in "y\n" it should page through that portion. I haven't done an installation lately, but I would suggest looking at passing in some return keys or something that would force the page down.
Sponsored Links
    #5  
Old 05-12-2008
eamani_sun eamani_sun is offline
Registered User
 
Join Date: May 2008
Last Activity: 14 October 2008, 12:57 PM EDT
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
I have tried that too, I have passed in some returns in the answer file, but it is not taking them as input to scroll down, instead it is accepting them at the eula agreement form.

I dont want user to give any kind of input for scrolling down.

Any kind of help would be great

Thanks in advance.

Sundeep
Sponsored Links
    #6  
Old 05-12-2008
primp primp is offline
Registered User
 
Join Date: Mar 2008
Last Activity: 22 December 2008, 11:35 PM EST
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Which JDK are you trying to install, do you have the version you're trying to automate the install? I can try it on my dev box and see what I come up with
Sponsored Links
    #7  
Old 12-06-2008
documentation.d documentation.d is offline
Registered User
 
Join Date: Dec 2008
Last Activity: 6 December 2008, 1:04 PM EST
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Tips to launch a silent install

Here's a tips I found trying to do the same as you :
1. Create an answers.txt file with the word y inside
2. Launch fhe following command (assuming you want to install jdk-xx.bin)
./jdk-xx.bin < answers.txt &>/dev/null

The install goes on slient.

Could you tell me if it works also for you ? (Just to be sure that this is not limited to my linux version).

Note : if you want to check if something went wrong you can echo $? (result of the install)
echo $? => 0 (ok)
echo $? => 1 (problem)
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
Help With Install Script scotbuff Shell Programming and Scripting 0 03-22-2010 10:05 AM
Install Script ice2257 Shell Programming and Scripting 6 12-15-2009 11:29 PM
install macbook pro fedora10 ???((<<if can install, how to install? >> )) kzBSD Linux 0 03-18-2009 02:57 AM
Install script potro Shell Programming and Scripting 2 06-20-2008 07:46 AM
Help with an install script dhs23 Shell Programming and Scripting 1 02-28-2008 05:01 PM



All times are GMT -4. The time now is 03:01 AM.