specifying dependencies for an rpm

I have built an rpm. But my project requires two softwares already to be installed :
1) java  (version 8)
2) maven (what ever latest version is available)

What i am expecting is when my rpm installs
it will check whether relevant java version and maven is installed and if not it will install those before
installing my rpm.

Also like if i want to download java or maven on my Mac i just say brew install java/maven
and it installs...how do i figure out whats the package name to be installed on linux for maven and java ?

Rohit BajajAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Shiju JacobInfo Security ManagerCommented:
if the linux(Redhat) server is connected to internet

yum install java-1.7.0-openjdk  

yum install maven

and if installed you can try yum upgrade packagename

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Rohit BajajAuthor Commented:
but i want to put that inside rpm dependency
do i nees to put those commands or i can just secify java and version number in rpm spec and it automatically takes care of it ?
or do i need to put in pre deploy section of an rpm
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.