• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

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: 42974
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: 20127
103
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.
 
I RELEASE YOU! (for now .... ) Feel free to peruse this tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!