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

NOTE: This article is 3 years or older so its information may no longer be relevant. Read on at your own discretion! Comments for this article have automatically been locked, refer to the FAQ for more details.
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


Skip down to comments...
A quick disclaimer...

Although I put in a great effort into researching all the topics I cover, mistakes can happen. If you spot something out of place, please do let me know.

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.
 
comments powered by Disqus
Other posts you may like...