• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Detecting java , ant script needed

 
Jas Oberai
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,
I have a ant based installer. Now,I want to write an ant script that should detect if java is already installed on the system or not.If not, it should try to install java that is there with the installer package.
So,any help as to how to accomplish this??
Thanks
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since Ant needs Java to run, it would be quite a miracle to get it to install Java if it isn't installed already
 
Jas Oberai
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply.I can try some other way to detect java for eg, I could run a batch script to start with,that should check to see if java is there or not.

If yes,launches the ant installer otherwise starts java installation.

Is that feasible?Any help on that??
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unix/Linux:

java -version >/dev/null || install-java.sh

Of course, if Java isn't installed, you probably didn't have an install-java sehll script either.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic