Conversation
| public static String installJava(int version) { | ||
| Preconditions.checkArgument(version == 6 || version == 7 || version == 8, "Supported Java versions are 6, 7, or 8"); | ||
| List<String> commands = new LinkedList<String>(); | ||
| commands.add(ok(addOpenJDKPPK())); |
There was a problem hiding this comment.
Should this only happen if the version is 6 or 7?
There was a problem hiding this comment.
sorry possibly I mean the other way round so you can ignore me
There was a problem hiding this comment.
Does it matter if the repo is enabled for the other versions too?
There was a problem hiding this comment.
I can't see any harm in it
| public static String installJava(int version) { | ||
| Preconditions.checkArgument(version == 6 || version == 7 || version == 8, "Supported Java versions are 6, 7, or 8"); | ||
| List<String> commands = new LinkedList<String>(); | ||
| commands.add(ok(addOpenJDKPPK())); |
There was a problem hiding this comment.
Shouldn't you wrap this in a ifExecutableElse1 instead of ok?
There was a problem hiding this comment.
OK ignores if the command fails (if the OS isn't Ubuntu for instance) so this should be fine. It's the pattern used elsewhere for similar things - see the lines below.
|
|
||
| /** | ||
| * Adds the PPA for OpenJDK for older JDK versions (7 and lower) required by some software (e.g. JBoss) | ||
| */ |
There was a problem hiding this comment.
Not sure that is the right was of doing this. I'm wondering if it would be better to handle this case by case, i.e. in the blueprints themselves
There was a problem hiding this comment.
I would agree and this is the case in YAML based blueprints, but this is the pattern used elsewhere, see JMX or NSS
There was a problem hiding this comment.
Fair enough too, let's go for that now but I would like to see a better pattern implemented in the future (if possible)
Versions of Java prior to 1.8 are not available by standard on Ubuntu 16.x+, this adds the repo for older versions required by some software.
Tested on CentOS / Ubuntu