languagetool-org/languagetool · error · RuntimeException
No rules are active. Please make sure your rule ids (<option
Error message
No rules are active. Please make sure your rule ids (<options.getEnabledRules()>) and category ids (<catIds>) are correct
What it means
After building the JLanguageTool instance and applying enabled/disabled rules, main() checks that at least one rule is active. If getAllActiveRules() is empty it throws with this message listing the enabled rule ids and category ids. It guards against running with a configuration that would check nothing.
Source
Thrown at languagetool-commandline/src/main/java/org/languagetool/commandline/Main.java:434
System.err.println("No language specified, using English (no spell checking active, " +
"specify a language variant like 'en-GB' if available)");
}
options.setLanguage(new English());
} else if (!options.isApplySuggestions()) {
languageHint = "Expected text language: " + options.getLanguage().getName();
}
options.getLanguage().getSentenceTokenizer().setSingleLineBreaksMarksParagraph(
options.isSingleLineBreakMarksParagraph());
Main prg = new Main(options);
if (options.getFalseFriendFile() != null) {
List<AbstractPatternRule> ffRules = prg.lt.loadFalseFriendRules(options.getFalseFriendFile());
for (AbstractPatternRule ffRule : ffRules) {
prg.lt.addRule(ffRule);
}
}
if (prg.lt.getAllActiveRules().isEmpty()) {
List<String> catIds = options.getEnabledCategories().stream().map(i -> i.toString()).collect(Collectors.toList());
throw new RuntimeException("No rules are active. Please make sure your rule ids " +
"(" + options.getEnabledRules() + ") and " +
"category ids (" + catIds + ") are correct");
}
if (languageHint != null) {
String spellHint = "";
if (!prg.isSpellCheckingActive()) {
if (prg.lt.getLanguage().isVariant()) {
spellHint = " (no spell checking active)";
} else {
spellHint = " (no spell checking active, specify a language variant like 'en-GB' if available)";
}
}
System.err.println(languageHint + spellHint);
}
prg.setListUnknownWords(options.isListUnknown());
if (options.isProfile()) {
prg.setProfilingMode();
}View on GitHub (pinned to 2e990059ce)
Solutions
- Print available rules with `languagetool -l <lang> --list` and match ids exactly (case-sensitive).
- Remove the --enable values to fall back to the language's default active rules.
- Verify category ids as well as rule ids; a wrong category with rules can also yield an empty set.
- Check you are not simultaneously disabling the rules you enabled (--disable overrides).
Example fix
// before languagetool -l de --enable EN_A_VS_AN file.txt // after languagetool -l en-US --enable EN_A_VS_AN file.txt
Defensive patterns
Strategy: validation
Validate before calling
Language lang = Languages.getLanguageForShortCode("en-US");
try (JLanguageTool lt = new JLanguageTool(lang)) {
Tools.selectRules(lt, disabled, enabled, true);
if (lt.getAllActiveRules().isEmpty()) {
throw new IllegalStateException("Configuration enables no rules for " + lang);
}
} Try / catch
if (lt.getAllActiveRules().isEmpty()) {
System.err.println("No active rules; check --enable ids against 'languagetool --list'");
System.exit(2);
} Prevention
- Copy rule ids exactly from --list output (case-sensitive).
- Don't pair --enable of one language's rules with another language.
- Remember --disable overrides --enable on the same rule.
When it happens
Trigger: Passing --enable ids (rules or categories via --enablecategories-equivalent options) that match no rules of the selected language, or disabling everything so no active rules remain.
Common situations: Typo in a rule id (case-sensitive); enabling a rule that belongs to a different language; enabling only rules hidden behind a premium/remote configuration; disabling all default categories.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- Parameter --config must be set and point to a property file
- Invalid port configuration found. The value for '--port' nee
- Cannot use --premiumAlways with non-premium version
- Missing argument for '--logIpMatchingPattern' (e.g. any rand
- maxWorkQueueSize must be >= 0:
AI-assisted analysis of languagetool-org/languagetool@2e990059ce (2026-09-06).
Data as JSON: /api/errors/6c28932d624e7a2c.
Report an issue: GitHub.