Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-36953

Can't compile Project with Java 8

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • None
    • Jenkins ver. 1.656
      browserstack-integration-plugin v1.0.2
      java 8

      I just followed the instructions here https://wiki.jenkins-ci.org/display/JENKINS/BrowserStack+Plugin and added the dependencies to the POM. However, the project fails to compile with the following errors:

      [ERROR] '<>' operator is not allowed for source level below 1.7
      /var/lib/jenkins/workspace/CognitoIQ-Projects/CognitoIQ-Services/Tests/WebUITests/FFIQ-Portal/CognitoDev/MobileManagementBrowserStack-CogDev-FFIQ-PortalTestAutomation/src/test/java/com/cognitomobile/ffiq/portal/test/retry/RetryAspect.java:39
      retryHistory = new ArrayList<>();

      [ERROR] '<>' operator is not allowed for source level below 1.7
      /var/lib/jenkins/workspace/CognitoIQ-Projects/CognitoIQ-Services/Tests/WebUITests/FFIQ-Portal/CognitoDev/MobileManagementBrowserStack-CogDev-FFIQ-PortalTestAutomation/src/test/java/com/cognitomobile/ffiq/portal/test/retry/RetryAspect.java:114
      ArrayList<String> componentNames = new ArrayList<>();

      [ERROR] Method references are allowed only at source level 1.8 or above
      /var/lib/jenkins/workspace/CognitoIQ-Projects/CognitoIQ-Services/Tests/WebUITests/FFIQ-Portal/CognitoDev/MobileManagementBrowserStack-CogDev-FFIQ-PortalTestAutomation/src/test/java/com/cognitomobile/ffiq/portal/test/retry/RetryAspect.java:130
      componentNames.forEach(ChartData::reloadChart);
      ^^^^^

      [ERROR] '<>' operator is not allowed for source level below 1.7
      /var/lib/jenkins/workspace/CognitoIQ-Projects/CognitoIQ-Services/Tests/WebUITests/FFIQ-Portal/CognitoDev/MobileManagementBrowserStack-CogDev-FFIQ-PortalTestAutomation/src/test/java/com/cognitomobile/ffiq/portal/test/browser/Browser.java:28
      private static Map<String, WebDriverWrapper> driverMap = new HashMap<>();
      ^^

      [ERROR] '<>' operator is not allowed for source level below 1.7
      /var/lib/jenkins/workspace/CognitoIQ-Projects/CognitoIQ-Services/Tests/WebUITests/FFIQ-Portal/CognitoDev/MobileManagementBrowserStack-CogDev-FFIQ-PortalTestAutomation/src/test/java/com/cognitomobile/ffiq/portal/test/browser/Browser.java:40
      Map<String, Object> prefs = new HashMap<>();

      [ERROR] Lambda expressions are allowed only at source level 1.8 or above
      /var/lib/jenkins/workspace/CognitoIQ-Projects/CognitoIQ-Services/Tests/WebUITests/FFIQ-Portal/CognitoDev/MobileManagementBrowserStack-CogDev-FFIQ-PortalTestAutomation/src/test/java/com/cognitomobile/ffiq/portal/test/browser/WebDriverWrapper.java:211
      ExpectedCondition<Boolean> pageLoad = driver -> ((JavascriptExecutor) driver).executeScript("return document.readyState").equals("complete");
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

      [ERROR] Lambda expressions are allowed only at source level 1.8 or above
      /var/lib/jenkins/workspace/CognitoIQ-Projects/CognitoIQ-Services/Tests/WebUITests/FFIQ-Portal/CognitoDev/MobileManagementBrowserStack-CogDev-FFIQ-PortalTestAutomation/src/test/java/com/cognitomobile/ffiq/portal/test/browser/WebDriverWrapper.java:221
      ExpectedCondition<Boolean> pageLoad = driver -> {

      [ERROR] '<>' operator is not allowed for source level below 1.7
      /var/lib/jenkins/workspace/CognitoIQ-Projects/CognitoIQ-Services/Tests/WebUITests/FFIQ-Portal/CognitoDev/MobileManagementBrowserStack-CogDev-FFIQ-PortalTestAutomation/src/test/java/com/cognitomobile/ffiq/portal/test/components/Bubble.java:14
      ArrayList<String> bubbleValues = new ArrayList<>();

      [ERROR] The method addAll(Collection<? extends String>) in the type ArrayList<String> is not applicable for the arguments (List<Object>)
      /var/lib/jenkins/workspace/CognitoIQ-Projects/CognitoIQ-Services/Tests/WebUITests/FFIQ-Portal/CognitoDev/MobileManagementBrowserStack-CogDev-FFIQ-PortalTestAutomation/src/test/java/com/cognitomobile/ffiq/portal/test/components/Bubble.java:16
      bubbleValues.addAll(getBubbles(chartName).stream().map(bubble -> (String) Browser.getInstance().executeScript("return $(\"[id = '" + bubble.getAttribute("id") + "']\").attr('ffiq_native_value');")).collect(Collectors.toList()));

      [ERROR] Lambda expressions are allowed only at source level 1.8 or above
      /var/lib/jenkins/workspace/CognitoIQ-Projects/CognitoIQ-Services/Tests/WebUITests/FFIQ-Portal/CognitoDev/MobileManagementBrowserStack-CogDev-FFIQ-PortalTestAutomation/src/test/java/com/cognitomobile/ffiq/portal/test/components/Bubble.java:16
      bubbleValues.addAll(getBubbles(chartName).stream().map(bubble -> (String) Browser.getInstance().executeScript("return $(\"[id = '" + bubble.getAttribute("id") + "']\").attr('ffiq_native_value');")).collect(Collectors.toList()));
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

      [ERROR] '<>' operator is not allowed for source level below 1.7
      /var/lib/jenkins/workspace/CognitoIQ-Projects/CognitoIQ-Services/Tests/WebUITests/FFIQ-Portal/CognitoDev/MobileManagementBrowserStack-CogDev-FFIQ-PortalTestAutomation/src/test/java/com/cognitomobile/ffiq/portal/test/components/Bubble.java:22
      ArrayList<WebElement> bubbles = new ArrayList<>();

      [ERROR] Multi-catch parameters are not allowed for source level below 1.7
      /var/lib/jenkins/workspace/CognitoIQ-Projects/CognitoIQ-Services/Tests/WebUITests/FFIQ-Portal/CognitoDev/MobileManagementBrowserStack-CogDev-FFIQ-PortalTestAutomation/src/test/java/com/cognitomobile/ffiq/portal/test/components/DragNode.java:44
      } catch (SAXException | ParserConfigurationException | IOException | XPathExpressionException e) {
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

      [ERROR] '<>' operator is not allowed for source level below 1.7
      /var/lib/jenkins/workspace/CognitoIQ-Projects/CognitoIQ-Services/Tests/WebUITests/FFIQ-Portal/CognitoDev/MobileManagementBrowserStack-CogDev-FFIQ-PortalTestAutomation/src/test/java/com/cognitomobile/ffiq/portal/test/components/DragNode.java:74
      List<String> seriesList = new ArrayList<>();

      The project compiles fine without these dependencies.

            browserstack BrowserStack Integrations
            emoshaya_cognitoiq Ebrahim Moshaya
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: