Amazon Elastic Bean Java How To Get Oracle JDK

I am new to Amazon web services and have recently inherited many existing services.

One of the things I desperately need is that our Amazon Elastic Beanstalk instance uses Sun Oracle JDK, not openJDK.

This inconsistency makes my java functions unusable since I am developing Java using Sun Oracle JDK. Our old code is based on JDK7.

For example, a JPEG codec does not exist in openJDK, and the Rhino javascript engine does not support the JSON.stringify function. I made workarounds for them, but it just avoids the big problem, which is that I have no idea openJDK does not support, and Oracle JDK seems to support almost everything.

According to the previous owner, I was advised not to create my own "AMI", because then I would have to take care of all the internal resources on my own. I was told that this would lead to a victory over the goal of the Elastic Bean Stack, presumably for all of us.

I can not find a direct answer. I do not want to leave the ecosystem of elastic beans. I believe that Amazon EC2 is a completely different ecosystem where I will have to manage all the internal servers.

I just want to know from that day, is it possible to have an Elastic Beanstalk instance for Tomcat7 with Oracle JDK?

I hope this is just a simple configuration change somewhere on the site.

If possible, can you provide instructions on how to do this?

+5
source share
1 answer

You can install your preferred JDK and change the java linux link to it, so it will be the default. Since EB instances are automatically created and destroyed by EB, you need to include a small script that tells EB to make the required java change whenever it decides to deploy a new web instance.
Now for this you will need to write a conf file and place it in the .ebextensions folder. in this file you manually install java and replace it with the current one.

The formal (tedious) documentation of eb configuration files is here .
To speed things up, check out this point .

+2
source

Source: https://habr.com/ru/post/1235323/


All Articles