Description of problem: Hello example is not compatible with java-1.6 due to use of "try-with-resources" (introduced in java-1.7). Other examples may be compiled with the following warning: major version 51 is newer than 50, the highest major version supported by this compiler. QE understanding is that the JMS client code shall be currently compatible with all RHEL6.6 supported java versions (1.6, 1.7 and 1.8). Note: MRG/M 3.0.0 (Vienna) JMS client/examples code required java-1.6 for build and java-1.5 for runtime. If there will be a decision to not support java-1.6 version, please change this bug to documentation bug and properly describe the java version compatibility in the related guide. Version-Release number of selected component (if applicable): qpid-java-*-0.30-3 java-1.6.0-openjdk-*-1.6.0.33-1.13.5.1 How reproducible: 100% Steps to Reproduce: 1. try to compile Hello.java example with java-1.6 2. Error Actual results: Examples can't be compiled with java-1.6 Expected results: Examples compatible with java-1.6 or Documentation update Additional info: # java -version java version "1.6.0_33" OpenJDK Runtime Environment (IcedTea6 1.13.5) (rhel-1.13.5.1.el6_6-i386) OpenJDK Client VM (build 23.25-b01, mixed mode) # rpm -qa | egrep "openjdk|qpid-java" qpid-java-example-0.30-3.el6.noarch java-1.6.0-openjdk-devel-1.6.0.33-1.13.5.1.el6_6.i686 java-1.6.0-openjdk-1.6.0.33-1.13.5.1.el6_6.i686 qpid-java-common-0.30-3.el6.noarch qpid-java-client-0.30-3.el6.noarch # javac -cp ${CLASSPATH} /usr/share/doc/qpid-java-0.30/examples/src/main/java/org/apache/qpid/example/Hello.java /usr/share/doc/qpid-java-0.30/examples/src/main/java/org/apache/qpid/example/Hello.java:53: '{' expected try (InputStream resourceAsStream = this.getClass().getResourceAsStream("hello.properties")) ^ /usr/share/doc/qpid-java-0.30/examples/src/main/java/org/apache/qpid/example/Hello.java:53: ')' expected try (InputStream resourceAsStream = this.getClass().getResourceAsStream("hello.properties")) ^ /usr/share/doc/qpid-java-0.30/examples/src/main/java/org/apache/qpid/example/Hello.java:53: ';' expected try (InputStream resourceAsStream = this.getClass().getResourceAsStream("hello.properties")) ^ /usr/share/doc/qpid-java-0.30/examples/src/main/java/org/apache/qpid/example/Hello.java:78: 'catch' without 'try' catch (Exception exp) ^ /usr/share/doc/qpid-java-0.30/examples/src/main/java/org/apache/qpid/example/Hello.java:78: ')' expected catch (Exception exp) ^ /usr/share/doc/qpid-java-0.30/examples/src/main/java/org/apache/qpid/example/Hello.java:78: not a statement catch (Exception exp) ^ /usr/share/doc/qpid-java-0.30/examples/src/main/java/org/apache/qpid/example/Hello.java:78: ';' expected catch (Exception exp) ^ /usr/share/doc/qpid-java-0.30/examples/src/main/java/org/apache/qpid/example/Hello.java:53: 'try' without 'catch' or 'finally' try (InputStream resourceAsStream = this.getClass().getResourceAsStream("hello.properties")) ^ /usr/share/doc/qpid-java-0.30/examples/src/main/java/org/apache/qpid/example/Hello.java:83: reached end of file while parsing } ^ 9 errors # javac -cp ${CLASSPATH} /usr/share/doc/qpid-java-0.30/examples/src/main/java/org/apache/qpid/example/Drain.java warning: /usr/share/java/qpid-client-0.30.redhat-1.jar(org/apache/qpid/client/AMQAnyDestination.class): major version 51 is newer than 50, the highest major version supported by this compiler. It is recommended that the compiler be upgraded. warning: ./org/apache/qpid/example/OptionParser.class: major version 51 is newer than 50, the highest major version supported by this compiler. It is recommended that the compiler be upgraded. warning: ./org/apache/qpid/example/OptionParser$Option.class: major version 51 is newer than 50, the highest major version supported by this compiler. It is recommended that the compiler be upgraded. warning: /usr/share/java/qpid-common-0.30.redhat-1.jar(org/apache/qpid/framing/AMQShortString.class): major version 51 is newer than 50, the highest major version supported by this compiler. It is recommended that the compiler be upgraded. warning: /usr/share/java/qpid-common-0.30.redhat-1.jar(org/apache/qpid/messaging/Address.class): major version 51 is newer than 50, the highest major version supported by this compiler. It is recommended that the compiler be upgraded. warning: /usr/share/java/qpid-common-0.30.redhat-1.jar(org/apache/qpid/url/BindingURL.class): major version 51 is newer than 50, the highest major version supported by this compiler. It is recommended that the compiler be upgraded. warning: /usr/share/java/qpid-client-0.30.redhat-1.jar(org/apache/qpid/client/AMQDestination.class): major version 51 is newer than 50, the highest major version supported by this compiler. It is recommended that the compiler be upgraded. 7 warnings
I do not think we can require "any-of-the-above", but we can use Conflicts to exclude 1.6: -- $ brew search package java-1.6* java-1.6.0-bea java-1.6.0-ibm java-1.6.0-sun java-1.6.0-openjdk -- Conflicts: java-1.6.0-bea, java-1.6.0-ibm, java-1.6.0-sun, java-1.6.0-openjdk -- What do you think?
(In reply to Irina Boverman from comment #5) > I do not think we can require "any-of-the-above", but we can use Conflicts > to exclude 1.6: > -- > $ brew search package java-1.6* > java-1.6.0-bea > java-1.6.0-ibm > java-1.6.0-sun > java-1.6.0-openjdk > -- > Conflicts: java-1.6.0-bea, java-1.6.0-ibm, java-1.6.0-sun, java-1.6.0-openjdk > -- > What do you think? One one hand this looks like the way (if we add also java-1.5.0-* ones) but digging more into detail java JDKs are coexisting RPMS installable into system in different directories as kernel does. So it looks we need to check with some packages in the same situation and possibly need to remove all rpm JVM/JDK deps and document it as JDK/JVM requirement. The problem with above approach is that we will force our customers/users to uninstall all above mackages listed in Conflicts. This may be unacceptable for at least two reasons: * some older java tools may want specific JVM/JDK playing with JAVA/JDK_HOME * some customers may want to have installed 1.6.0 and 1.7.0 and use earlier as default and play with JAVA/JDK_HOME for qpid-java Both reasons are rather corner ones and I think we need to discuss with someone who knows the guideline here (mikeb for instance)?
Release note added, content approved. -> VERIFIED