Ask Your Question

How do I use the java module from forge to install a specific version of java?

asked 2015-11-13 16:10:46 -0600

catpants gravatar image

Hi folks,

Trying to use the java module from forge to install a specific version of the jre. I have tried:

class { 'java':          
  distribution => 'jre', 
  version => '1.6.0', 


class { 'java':          
  distribution => 'jre', 
  version => '1.6', 

and this:

class { 'java':          
  distribution => 'jre', 
  version => '6', 

All with no luck. The error I get always looks like:

Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold --force-yes install openjdk-7-jre-headless=1.6.0' returned 100:

This module is listed as "supported" by puppet labs, so I would imagine this is supposed to work out of the box.


edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2015-11-13 19:05:09 -0600

lavaman gravatar image

That module simply uses your OS package management to install the java package. Does openjdk-7-jre-headless actually exist in your apt repos at the version you are attempting to install?

If not, you need to make them available.

edit flag offensive delete link more


This is explained in more detail in the module's "Limitations" section:

aharden gravatar imageaharden ( 2015-11-16 09:25:22 -0600 )edit

If I'm trying to install version 6 of the jre, wouldn't I be looking for "openjdk-6-jre-headless"? Yes, "openjdk-6-jre-headless" exists in my apt repos.

catpants gravatar imagecatpants ( 2015-11-16 12:00:01 -0600 )edit

I was just going off the output you listed above. Apt is attempting to install openjdk-7. Also, you can always run the command puppet is executing to see why it is failing.

lavaman gravatar imagelavaman ( 2015-11-18 16:19:48 -0600 )edit

answered 2015-11-17 01:11:06 -0600

try this class {'java': package => 'java-1.8.0-openjdk.x86_64', distribution => 'jre', }

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2015-11-13 16:10:46 -0600

Seen: 238 times

Last updated: Nov 13 '15