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

Hope you found this post useful...

...so please read on! I love writing articles that provide beneficial information, tips and examples to my readers. All information on my blog is provided free of charge and I encourage you to share it as you wish. There is a small favour I ask in return however - engage in comments below, provide feedback, and if you see mistakes let me know.

If you want to show additional support and help me pay for web hosting and domain name registration, donations, no matter how small, are always welcome!

Use of any information contained in this blog post/article is subject to this disclaimer.
comments powered by Disqus
Other posts you may like...