Github user bostko commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/722#discussion_r33456465
  
    --- Diff: 
software/base/src/main/java/brooklyn/entity/java/JavaSoftwareProcessSshDriver.java
 ---
    @@ -336,7 +336,7 @@ protected int tryJavaInstall(String version, String 
command) {
             log.debug("Checking Java version at {}@{}", getEntity(), 
getLocation());
             // sed gets stdin like 'java version "1.7.0_45"'
             ProcessTaskWrapper<Integer> versionCommand = 
Entities.submit(getEntity(), SshTasks.newSshExecTaskFactory(
    -                getLocation(), "java -version 2>&1 | grep \"java version\" 
| sed 's/.*\"\\(.*\\).*\"/\\1/'"));
    +                getLocation(), "java -version 2>&1 | grep \" version\" | 
sed 's/.*\"\\(.*\\).*\"/\\1/'"));
    --- End diff --
    
    I've included a comment in the commit.
    Here is what `java -version` returns on my side
    ```
    openjdk version "1.8.0_45"
    OpenJDK Runtime Environment (build 1.8.0_45-b14)
    OpenJDK 64-Bit Server VM (build 25.45-b02, mixed mode)
    ```
    However we could consider using `grep -E "(openjdk|java) version"`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to