Unable to fix “Syntax error, 'for each' st

2019-06-24 09:44发布

I am writing a Java Agent which uses parameterized collection types and enhanced-for loops. Domino Designer 8.5.3 then tells me to change the project's compliance level to 1.5 in a quick-fix action.

If I do that, the project rebuilds and nothing changes. Nothing happens if I go to the project's Java Compiler settings to set it manually, or change it in the workspace settings either. How can I get rid of this error?

1条回答
2楼-- · 2019-06-24 10:42

There is an annoying bug in Domino Designer. The "Compiler Compliance Level" in File / Preferences will always show 1.5 after a client restart and has no affect at all on Java Agents.

To set the compliance level for an agent open the agent and open a java class. Open Menu Project / Properties -> Java Compiler. Set to "Enable Project special settings" and set "Compiler Compliance Level" to 1.6.

enter image description here

To view the compliance level for a agent open the agent view, click on a agent (don't open it) an look at Properties / Fields, the fields "$JavaCompilerSource" and "$JavaCompilerTarget" will show the information.

enter image description here

查看更多
登录 后发表回答