cancel
Showing results for 
Search instead for 
Did you mean: 

SAP PO 7.5 - UDF with JAVA 1.8

0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member183909
Active Participant
0 Kudos

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;

manoj_khavatkopp
Active Contributor
0 Kudos

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