Skip to Content
avatar image
Former Member

SAP PO 7.5 - UDF with JAVA 1.8

Hi,

i have a question to SAP PO 7.5 and JAVA UDF function. I want to use a JAVA feature like:

try (BufferedReader br = new BufferedReader(new FileReader(path))) {
return br.readLine();
}

In PI 7.5 i receiving the following error:

try-with-resources is not supported in -source 1.5 (use -source 7 or higher to enable try-with-resources)

What is to do? I thought SAP PO 7.5 supports already JAVA 1.8.

Regards,

Marcus

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Aug 30, 2017 at 07:21 AM

    I also had similar question on the SWITCH statement comparing a string - that should work under Java 1.7 - but it does not work under SAP PO7.5 that is running Java 1.8. We have just installed SAP PO7.5 in a test machine.

    error: strings in switch are not supported in -source 1.5 (use -source 7 or higher to enable strings in switch)

    I have checked the JAVA version in a UDF and returns 1.8.0_144 - so the version is higher correct.

    String version = System.getProperty("java.version");
    return version;

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 29, 2017 at 09:59 AM

    Hi Marcus,

    I remember a recent thread was raised for the same issue with Switch not working with 1.8 and was throwing the similar error , the recent update was the SAP would update this is in upcoming patch to take the version 1.8 and not 1.5.

    Br,

    Manoj

    Add comment
    10|10000 characters needed characters exceeded