If we look at the Java standard §14.7, we see that statements may have label prefixes, e.g.:
LabeledStatement:
Identifie
The expression
int k = 3;
is a local variable declaration statement.
The statement used in the syntax of a label statement
LabeledStatement
:
Identifier
: Statement
does not contain local variable declaration statements. You therefore can't use them within a labeled statement directly.
Local variable declaration statements can be used within blocks which can be used within labeled statements.