# Need help for install java

**URL:** <https://forum.ansible.com/t/need-help-for-install-java/33457>\
**Category:** Ansible Project\
**Created:** [July 21, 2020, 8:04pm UTC](https://forum.ansible.com/t/need-help-for-install-java/33457 "2020-07-21T20:04:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rajeeb\_sahoo](https://avatars.discourse-cdn.com/v4/letter/r/8e8cbc/32.png) [@Rajeeb\_sahoo](https://forum.ansible.com/u/Rajeeb_sahoo)\
**Post date:** [July 21, 2020, 8:04pm UTC](https://forum.ansible.com/t/need-help-for-install-java/33457/1 "2020-07-21T20:04:50Z")

</div>

Hello,  
I am new in Ansible.  
I need to install ORACLE JAVA 8 and that package is in .deb. (jdk1.8\_1.8.0231-1\_amd64.deb, jre1.8\_1.8.0211-1\_amd64.deb)  
can anyone help me out to write ansible code for install java with the above condition?

Thanks  
Rajeeb

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [July 21, 2020, 8:25pm UTC](https://forum.ansible.com/t/need-help-for-install-java/33457/2 "2020-07-21T20:25:03Z")

</div>

Best to get started first:  
[https://docs.ansible.com/ansible/latest/user\_guide/intro\_getting\_started.html](https://docs.ansible.com/ansible/latest/user_guide/intro_getting_started.html)  
Then try this for your first playbook:  
[https://docs.ansible.com/ansible/latest/modules/apt\_module.html](https://docs.ansible.com/ansible/latest/modules/apt_module.html)

---

<div class="post-metadata">

**Author:** ![Rajeeb\_sahoo](https://avatars.discourse-cdn.com/v4/letter/r/8e8cbc/32.png) [@Rajeeb\_sahoo](https://forum.ansible.com/u/Rajeeb_sahoo)\
**Post date:** [July 21, 2020, 8:41pm UTC](https://forum.ansible.com/t/need-help-for-install-java/33457/3 "2020-07-21T20:41:15Z")

</div>

- name: Install java DEB package  
hosts: ubuntu\_test  
become: yes  
tasks:

- name: Copy jdk.deb file  
copy:  
src: /home/centos/jdk1.8\_1.8.0231-1\_amd64.deb  
dest: /tmp

- name: Installing jdk.deb package  
apt:  
deb: /tmp/jdk1.8\_1.8.0231-1\_amd64.deb  
state: present

- name: Copy jre.deb file  
copy:  
src: /home/centos/jre1.8\_1.8.0211-1\_amd64.deb  
dest: /tmp

- name: Installing jre.deb package  
apt:  
deb: /tmp/jre1.8\_1.8.0211-1\_amd64.deb  
state: present

Ran this. but it’s not installing in remote rserver

---

<div class="post-metadata">

**Author:** ![jean-yves](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jean-yves](https://forum.ansible.com/u/jean-yves)\
**Post date:** [July 21, 2020, 11:09pm UTC](https://forum.ansible.com/t/need-help-for-install-java/33457/4 "2020-07-21T23:09:41Z")

</div>

Hi,

Where did the package come from ? (sound like alien package of an rpm ?)

Some ideas :

- If the package came from Oracle, very often, an interaction is needed to accept EULA… (I had that kind of problem on CentOS a while ago)

- Have you tried a manual install ?

- Also I saw that `xz-utils is needed on remote server (look at documentation on apt). Perhaps your playbook should ensure it is installed before...`

`- If you want a specific jdk version not packaged for debian, use `` **make** -jpkg to create a good package that can be installed without prompting user.`

Regards,

JYL

---

<div class="post-metadata">

**Author:** ![Rajeeb\_sahoo](https://avatars.discourse-cdn.com/v4/letter/r/8e8cbc/32.png) [@Rajeeb\_sahoo](https://forum.ansible.com/u/Rajeeb_sahoo)\
**Post date:** [July 22, 2020, 1:38pm UTC](https://forum.ansible.com/t/need-help-for-install-java/33457/5 "2020-07-22T13:38:52Z")

</div>

Hi

I have a licensed version of rpm. I had converted .rpm to .deb through alien

I tried with manually but it’s not happing.

are you telling me that I should install xz-utils?

I want a specific version like java 8 .deb package.
