JetBrains/intellij-community · error · BuildException
Prompt is null
Error message
Prompt is null
What it means
IdeaInputHandler is the Ant InputHandler that pipes Ant <input> task prompts to the IDE UI via packets. Ant's InputRequest.getPrompt() should always carry the prompt text; if it is null the handler cannot build a meaningful request and fails fast with BuildException("Prompt is null").
Source
Thrown at java/java-runtime/src/com/intellij/rt/ant/execution/IdeaInputHandler.java:17
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.rt.ant.execution;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.input.InputHandler;
import org.apache.tools.ant.input.InputRequest;
import org.apache.tools.ant.input.MultipleChoiceInputRequest;
import java.io.IOException;
import java.util.List;
public class IdeaInputHandler implements InputHandler {
@Override
public void handleInput(InputRequest request) throws BuildException {
final String prompt = request.getPrompt();
if (prompt == null) {
throw new BuildException("Prompt is null");
}
final SegmentedOutputStream err = IdeaAntLogger2.ourErr;
if (err == null) {
throw new BuildException("Selected InputHandler should be used by Intellij IDEA");
}
final PacketWriter packet = PacketFactory.ourInstance.createPacket(AntLoggerConstants.INPUT_REQUEST);
packet.appendLimitedString(prompt);
packet.appendLimitedString(request.getDefaultValue());
if (request instanceof MultipleChoiceInputRequest) {
@SuppressWarnings("unchecked")
List<String> choices = ((MultipleChoiceInputRequest)request).getChoices();
if (choices != null && !choices.isEmpty()) {
int count = choices.size();
packet.appendLong(count);
for (String choice : choices) {
packet.appendLimitedString(choice);
}
}View on GitHub (pinned to be881553f2)
Solutions
- Fix the build/task so every <input> task has a non-empty prompt attribute (validtext/message).
- If a custom task creates InputRequest programmatically, pass a non-null prompt string.
- As a workaround, run the build with a different input handler (e.g. -inputhandler org.apache.tools.ant.input.DefaultInputHandler) to see where the null prompt originates.
Example fix
<!-- before --> <input addproperty="v"/> <!-- after --> <input message="Enter value:" addproperty="v"/>
Defensive patterns
Strategy: validation
Validate before calling
<input message="Enter value:" addproperty="v"/> <!-- always provide message/prompt -->
Prevention
- Give every <input> task a message attribute.
- Pass non-null prompts when constructing InputRequest in custom tasks.
When it happens
Trigger: An Ant build executes an <input> task whose request was constructed without a prompt string (custom Ant version or a task creating InputRequest(null, ...)), and the build uses -inputhandler com.intellij.rt.ant.execution.IdeaInputHandler.
Common situations: Custom Ant tasks or macros that instantiate InputRequest directly with a null prompt; malformed third-party build files; running the same build under IDEA where the IDE-specific input handler is forced on.
Related errors
- \nThe version of the executed Ant is not compatible with the
- Selected InputHandler should be used by Intellij IDEA
- Invalid input: {input}
- Malformed exclusion, 'groupId:artifactName' format is expect
- Row %d failed: hierarchicalIdx cannot be null
AI-assisted analysis of JetBrains/intellij-community@be881553f2 (2026-08-14).
Data as JSON: /api/errors/aff3aafdf084bc15.
Report an issue: GitHub.