title: How can I install java using CloudFormation
body: <p>I want to install the latest java using CloudFormation template. The Instance is RedHat 7.</p>
  
  <p>Currently I wrote:</p>
  
  <pre><code>"AWS::CloudFormation::Init": {
              "config": {
                  "packages": {
                      "yum": {
                          "httpd": [ ]
                      }
                  },
                  "services": {
                      "sysvinit": {
                          "httpd": {
                              "enabled": "true",
                              "ensureRunning": "true"
                          }
                      }
                  }
              }
          }
  </code></pre>
  
  <p>Java is installed, but not the latest version. My new service depend on a newer version of Java. What do I need to change in the "yum" block ?</p>