Skip to Content
0

SAP PO 7.5 - UDF with JAVA 1.8

Aug 29, 2017 at 09:49 AM

67

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Jonny Wellard Aug 30, 2017 at 07:21 AM
0

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;

Share
10 |10000 characters needed characters left characters exceeded
Manoj K Aug 29, 2017 at 09:59 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded