简体   繁体   中英

NetBeans IDE Java 1.4 compatibility: compiler not warning on JDK 5+ classes/methods

When NetBeans 7 (or NetBeans 3.6) is compiling with -source 1.4 enabled, why doesn't it warn when compiling with methods (or classes) introduced @since 1.5 or @since 1.6 ?

The javac docs imply that the -source option is about language features , not library features .

-source release
Specifies the version of source code accepted. The following values for release are allowed:

  • 1.3 The compiler does not support assertions, generics, or other language features introduced after JDK 1.3.

  • 1.4 The compiler accepts code containing assertions, which were introduced in JDK 1.4.

  • 1.5 The compiler accepts code containing generics and other language features introduced in JDK 5.

  • 5 Synonym for 1.5.

  • 1.6 This is the default value. No language changes were introduced in Java SE 6. However, encoding errors in source files are now reported as errors, instead of warnings, as previously.

  • 6 Synonym for 1.6.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM