Spring Boot
IntelliJ
Error Code
Troubleshooting
Java Development

Process finished with exit code 1 Spring Boot Intellij

Interview Questions practice on Codemia

Over 8,000 real interview questions from top companies, searchable by company and role.

Browse interview questions

Introduction

Process finished with exit code 1 in IntelliJ is not the diagnosis. It only tells you the Spring Boot process terminated with an error. The real cause is always in the stack trace, startup log, or exception message that appeared before IntelliJ printed that final summary line.

Read the First Meaningful Failure

The most useful log line is usually not the last one. It is the first exception or startup failure message that explains why the application aborted.

Common examples include:

  • 'Port 8080 was already in use'
  • 'Failed to configure a DataSource'
  • 'BeanCreationException'
  • 'NoSuchBeanDefinitionException'
  • 'ClassNotFoundException'
  • 'ConfigDataResourceNotFoundException'

The exit code is identical for many different failures, so stop debugging at the line that explains the failure, not at IntelliJ's process summary.

Common Spring Boot Startup Causes

A small set of issues explains many exit-code-1 runs:

  • port conflict
  • invalid application configuration
  • missing environment variables or secrets
  • broken datasource setup
  • bean wiring errors
  • bad dependency versions
  • wrong Java version for the project

The application exits because Spring Boot failed to initialize the context or failed later during runtime startup hooks. The code 1 only says the process ended unsuccessfully.

Example: Port Already in Use

A frequent failure is another service already listening on the default port. You can change the port temporarily to confirm the diagnosis.

properties
server.port=8081

Or inspect the current owner of the default port:

bash
lsof -i :8080

If the app starts on another port, the issue was a port conflict, not a Spring Boot bug.

Example: Datasource or Profile Misconfiguration

Many Spring Boot applications depend on profile-specific configuration files or environment variables. If the wrong profile is active in IntelliJ, the app may fail because the datasource URL, username, password, or secret value is missing.

A typical configuration block looks like this:

properties
spring.datasource.url=jdbc:postgresql://localhost:5432/appdb
spring.datasource.username=appuser
spring.datasource.password=secret

If any required setting is absent or invalid, context initialization may stop with exit code 1.

Check IntelliJ Run Configuration Separately

Sometimes the project works from the command line but fails inside IntelliJ. In that case, compare the run configuration against the shell environment.

Check these items in IntelliJ:

  • selected main class
  • module classpath
  • active Spring profile
  • environment variables
  • VM options
  • JDK used by the run configuration

A mismatch here can explain why the application fails in the IDE while mvn spring-boot:run or ./gradlew bootRun succeeds.

Reproduce Outside the IDE

Running outside IntelliJ is one of the fastest ways to narrow the problem.

For Maven:

bash
./mvnw spring-boot:run

For Gradle:

bash
./gradlew bootRun

If the same failure occurs, the problem is probably in the application or environment. If the command-line run succeeds but IntelliJ fails, focus on the IDE configuration rather than the application code.

Fix the First Error Before Chasing Secondary Errors

Spring Boot startup failures can cascade. One missing bean or broken configuration may trigger several follow-up exceptions that look unrelated. Fix the first meaningful failure and rerun before touching anything else.

This is especially important in large applications where auto-configuration errors can produce long traces. The first real cause is usually much simpler than the bottom of the stack trace makes it look.

Common Pitfalls

The biggest mistake is treating exit code 1 itself as the root cause. It is only the launcher's summary of failure.

Another mistake is changing random settings before reading the first real exception. That often creates new variables while leaving the original problem untouched.

Teams also forget to compare IntelliJ's run configuration with the command-line environment, even though that difference is a frequent source of Spring Boot startup bugs.

Summary

  • 'Process finished with exit code 1 only means the Spring Boot process failed.'
  • The real diagnosis is in the earlier log lines or exception stack trace.
  • Port conflicts, datasource issues, bad configuration, and bean wiring problems are common causes.
  • Compare IntelliJ settings with the command-line environment if the failure is IDE-specific.
  • Fix the first meaningful startup error, then rerun before chasing later symptoms.

Related reading
Course
Intermediate
27 lessons
14 hours
OOD Fundamentals

Master object-oriented design from first principles, SOLID, design patterns, and classic interview problems with hands-on coding.

View the course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

Interview Questions practice on Codemia

Over 8,000 real interview questions from top companies, searchable by company and role.

Browse interview questions

All Rights Reserved.