In Java 1.5, to abandon the method you:
@Deprecated int foo(int bar) { }
Compiling this in Java 1.6 leads to the following:
Syntax error, annotations only available if source level 1.5
Any ideas?
You should tell the compiler to use 1.6:
javac -source 1.6
Or the equivalent for your IDE / build system (as others have suggested).
Firstly, its @Deprecated, and secondly, double check if you are really compiling Java 1.6. What are you using? Javac Eclipse?
@Deprecated
javac, , JAVA_HOME JDK 6, JDK 1.4.2 Eclipse ( IDE), > a > .
, , 1,5
IDE. 1.4 . , Eclipse ( , Eclipse), Java > 1.5 . Java .
Eclipse IDE,
1- Project Explorer
2 → → Java
3- " "
4- " " "1.6"
. 1.6, 1.5.
5- "".
IDE , . Apply, .
, , , , Eclipse.
, Java ( > > Java > ), , 1.6. , . .
. > a > Java. , , 1,4, , . , , , 1,5 .
.
, 1.5. Java 6 .
? Eclipse, / /JDK?
javac,
javac -version
, .
, Java 1.6, 1.4 ( )? ?
@Deprecated @Deprecate
@Deprecate
Eclipse, , Java Compiler 1.6.
, java 1.6 eclipse. , . Java " ", 1.6, . .
Source: https://habr.com/ru/post/1723792/More articles:Unbound column value disappears from DataGridView in sort - .netWhy is this use of Java Generics not compiled? - javaCan I stick history in SVN? - svnWPF ListBox - как поместить значения из dataTable? - data-bindingDynamic JavaScript loading with compression - javascriptUTF-8, PHP and XML Mysql - phphttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1723794/mysql-latin1-utf8-convert-characters-to-their-multibyte-equivalents&usg=ALkJrhgPHPaJ1r-8EYsEUroXwc5AQT4mjgSQL with a table name as a parameter and a query longer than 4000 characters - sqlLanguage Selection CGI - ruby | fooobar.comWho is calling my WebService? - loggingAll Articles