Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

Now that Java 8 has been released, you would think that the IDE that comes from the makers of Java would support all of the language syntax that dates back to the Java 7 days, but alas it does not. I tried both JDeveloper 11g (11.1.2.0.0) and 12c (12.1.2.0.0) and neither appear to support the try-with-resources syntax that was introduced as a part of JDK 7. However, compiling the code has no problems, both IDEs are able to compile source code that is using this new syntax.

Here's a screenshot of what happens in JDeveloper 12c when trying to use this syntax.
jdevtwr2.png


The try-with-resources is described at the Java Tutorial page here.



"Try statement: Expecting {." is the error, well it's not really a syntax error here, just lack of support from the IDE.


Edit: This does work in JDev 12c, but only AFTER you set the compiler source version to 1.7 AND restart JDeveloper. Just changing the source version has no immediate effect.


-i


A quick disclaimer...

Although I put in a great effort into researching all the topics I cover, mistakes can happen. Use of any information from my blog posts should be at own risk and I do not hold any liability towards any information misuse or damages caused by following any of my posts.

All content and opinions expressed on this Blog are my own and do not represent the opinions of my employer (Oracle). Use of any information contained in this blog post/article is subject to this disclaimer.
Hi! You can search my blog here ⤵
NOTE: (2022) This Blog is no longer maintained and I will not be answering any emails or comments.

I am now focusing on Atari Gamer.