• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Detecting java , ant script needed  RSS feed

 
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
 
Rancher
Posts: 42975
76
  • 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??
 
Bartender
Posts: 19731
92
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
Boost this thread!