DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Orchestration Meets MCP: Building Governed Agentic Workflows With Quarkus Flow and AGENTS.md
  • AGENTS.md Makes Your Java Codebase AI-Agent Ready
  • Jakarta NoSQL: Why JPA Is Not Enough for the AI Era
  • Implementing the Planning Pattern With Java Enterprise and LangChain4j

Trending

  • Understanding Agentic SDLC: The Future of Software Engineering
  • Why AWS and Azure Handle Data Perimeter Differently
  • Using AIDLC to Build Documents (Not Just Code)
  • The Agent in Your Pipeline Doesn't Have a Manager. That's the Problem.
  1. DZone
  2. Data Engineering
  3. AI/ML
  4. Java Enterprise Is Already Ready for the AI Era

Java Enterprise Is Already Ready for the AI Era

Java Enterprise is ready for AI today. Jakarta EE integrates with AI providers and frameworks, while Jakarta Agentic AI and Jakarta EE 12 strengthen it.

By 
Otavio Santana user avatar
Otavio Santana
DZone Core CORE ·
Aug. 18, 26 · Analysis
Likes (0)
Comment
Save
Tweet
Share
143 Views

Join the DZone community and get the full member experience.

Join For Free

Artificial intelligence is changing software engineering, impacting automation, user interaction, data analysis, and application development. Developers are evaluating how their technology stacks fit with these changes. For Java developers in enterprise settings, a main question is whether the Java enterprise ecosystem is prepared for AI.

The short answer is yes. You do not need to abandon Java or wait for a new platform to build AI-enabled applications. Java already provides a mature ecosystem of AI libraries, model providers, APIs, and integration patterns. Jakarta EE offers the capabilities required to deploy these technologies in production-grade enterprise systems today.

The ecosystem is evolving, with new initiatives exploring perfect integration of AI concepts within Jakarta EE APIs and programming models. This article reviews existing capabilities, Jakarta EE’s role within modern AI architectures, and potential future developments.

AI and Software Engineering

When applying artificial intelligence in software engineering, it is important to distinguish the different ways AI can be used throughout the development lifecycle. AI can assist with documentation, testing, code reviews, architecture exploration, and code generation. Architecturally, these uses fall into two categories: using AI to develop software and integrating AI within the software itself.

The first category, AI-assisted software development, is currently the most common. Developers use AI tools to generate, explain, refactor, or test code. While these tools can boost productivity, they also introduce risks if not used with proper engineering discipline. Insufficient context, unreviewed code, or tools lacking architectural constraints can cause defects, security issues, complexity, or inconsistent design. AI does not replace the engineering team; it remains their responsibility to use it effectively.

New methodologies are emerging to structure this interaction. Approaches like vibe coding focus on rapid development through conversational AI, while Spec-Driven Development offers explicit requirements, constraints, and context before code generation. Agent-based workflows increasingly use repositories with instructions, specifications, and Markdown files to give coding agents the required context. These approaches do not require abandoning Java; Java projects can already employ these techniques.

The second category entails integrating AI within the application itself, making AI part of the application's runtime behavior rather than just assisting developers. Applications may use a large language model (LLM) to classify information, generate content, extract structured data, retrieve knowledge, execute tools, or make decisions within business workflows.

This combination delivers a fundamental architectural change. Traditional enterprise applications are predominantly deterministic: developers define process flow using methods, conditions, rules, workflows, and state changes. With the same inputs and state, the execution path is predictable. In contrast, AI-enabled applications can present a dynamic execution model, where some behavior is determined at runtime via the LLM.

However, not every AI-enabled application should surrender control to the model. In practice, AI architectures exist on a spectrum of autonomy. At one end, the model functions within a tightly controlled deterministic workflow. As autonomy increases, the model can select tools, plan steps, evaluate results, and coordinate more complex actions.

This evolution is reflected in the Core Autonomy Patterns, which start with deterministic directed acyclic graph (DAG) workflows and progress toward more autonomous approaches such as retrieval-augmented generation (RAG), reflection, planning, ReAct, multi-agent systems, and Model Context Protocol (MCP) integrations. As flexibility increases, so does the architectural responsibility for observability, security, testing, governance, failure handling, and control.

Recognizing this distinction is essential when evaluating Jakarta EE’s readiness for AI. The first category already integrates naturally with Java development tools. The second stresses the importance of the enterprise platform: AI applications still require dependency injection, configuration, REST APIs, persistence, messaging, transactions, security, observability, asynchronous execution, and integration with external systems. These are the capabilities Jakarta EE was designed to provide.

Jakarta EE and AI Now

Java and Jakarta EE are ready for the AI era. Integrating AI does not require leaving the enterprise Java ecosystem or waiting for new specifications. Jakarta EE applications can already use large language models (LLMs), embed AI in business workflows, and employ these capabilities within the wider enterprise platform.

This is evident inside real-world applications. For example, Skillwell Simulate, a Jakarta EE-based platform, integrates with AWS services and uses Amazon Bedrock for AI features. This shows that Jakarta EE applications can adopt modern AI services while retaining the benefits of established enterprise architecture.

At the lowest abstraction level, applications can integrate directly with AI providers such as OpenAI, Anthropic, Google, and Amazon Bedrock using their APIs or Java SDKs. This approach delivers full access to provider-specific features but increases coupling. Each provider uses different API models, configurations, formats, authentication, and features. Supporting multiple providers can add boilerplate and increase complexity.

Enterprise developers are familiar with this challenge. Different vendors and technologies offer different capabilities, so abstractions provide a unified programming model. AI integration is now adopting a similar approach.

OmniHai is a lightweight Java AI library for Jakarta EE and MicroProfile applications. Instead of requiring each vendor's SDK, OmniHai provides a consistent AIService abstraction and communicates directly with provider REST APIs. It currently supports OpenAI, Anthropic, Google AI, xAI, Mistral, Meta AI, Azure OpenAI, OpenRouter, Hugging Face, Ollama, and custom providers.

With CDI, an AI provider can be injected directly into a Jakarta EE component:

Java
 
@Inject
@AI(provider = AIProvider.ANTHROPIC,apiKey = "your-anthropic-api-key")
private AIService claude;


The application interacts with AIService instead of provider-specific APIs. This enables chat interactions to use a consistent programming model across providers:

Java
 
String response = claude.chat(
   "Explain microservices",
   ChatOptions.newBuilder()
       .systemPrompt("You are a helpful software architect.")
       .temperature(0.5)
       .maxTokens(500)
       .build()
);


OmniHai also supports asynchronous and streaming operations through the same abstraction.

Conceptually, this approach is similar to abstractions like EntityManager in Jakarta Persistence: the application uses a common API while implementation details remain hidden. Although not a perfect comparison, it illustrates OmniHai’s role in managing multiple AI providers.

LangChain4j CDI offers a higher-level programming model. Instead of working directly with an AIService object, developers define an AI service as a Java interface. LangChain4j CDI detects interfaces annotated with @RegisterAIService and supplies their implementations as CDI beans.

For example:

Java
 
@RegisterAIService
public interface AssistantService {

   @SystemMessage("You are a helpful assistant.")
   String chat(String userMessage);
}


Developers do not write implementation classes. The infrastructure generates the implementation and connects the interface to the configured language model. The resulting service can be injected as any other CDI bean:

Java
 
@Path("/assistant")
public class AssistantResource {

   @Inject
   AssistantService assistant;

   @GET
   @Path("/chat")
   public String chat(@QueryParam("message") String message) {
       return assistant.chat(message);
   }
}


This programming model will be familiar to Jakarta EE developers. It is similar to the repository abstraction in Jakarta Data, where developers define the contract through an interface and the infrastructure supplies the implementation. Although the technologies address different needs, this model reduces the amount of infrastructure code developers must write.

LangChain4j goes beyond basic model invocation. It offers unified APIs for over 20 LLM providers and includes abstractions for tools, Retrieval-Augmented Generation (RAG), chat memory, structured outputs, agents, embedding stores, and other AI features. Supported integrations include Amazon Bedrock, Anthropic, Azure OpenAI, Google AI Gemini, OpenAI, Mistral, OCI Generative AI, among others.

These options represent different levels of abstraction:


OmniHai serves as a lightweight template-style abstraction, allowing the application to invoke operations through a common AIService. LangChain4j CDI advances this by supplying a declarative interface-based model, where developers describe the AI service and the infrastructure provides its implementation.

Both approaches ensure the application stays a Jakarta EE application. Once an AI capability is available as a CDI bean, it integrates perfectly with the platform. REST endpoints can expose it, Jakarta Persistence or Jakarta NoSQL can supply data, Jakarta Security can protect its operations, Jakarta Messaging can trigger asynchronous workflows, and other Jakarta EE APIs continue their roles.

The question is no longer whether Jakarta EE can integrate with AI; it already does. The key architectural decision is now the required level of abstraction: direct provider integration for maximum control, a lightweight common API like OmniHai, or a richer AI programming model such as LangChain4j CDI.

Jakarta EE and Future

Jakarta EE already supports AI integration, and the platform continues to evolve. Jakarta EE 12 focuses on improving the data layer, with updates to Jakarta Data, Jakarta Persistence, Jakarta NoSQL, and the new Jakarta Query specification. These improvements are especially important for AI applications that rely on enterprise data, persistence, retrieval, and contextual content.

The primary AI-focused initiative is Jakarta Agentic AI, which has released its first milestone. Its purpose is not to replace LangChain4j or provider SDKs, but to offer a standard programming model for building AI agents with Jakarta EE.

The specification defines a small set of concepts to structure agent workflows based on annotations, thus making the developer's life way easier:

API Purpose

@Agent

Declares an agent class

@Trigger

Defines the workflow entry point

@Decision

Determines whether and how the workflow proceeds

@Action

Defines a step in the workflow

@Outcome

Marks the end of the workflow

@HandleException

Handles exceptions inside the workflow

@WorkflowScoped

Provides one CDI context per workflow execution

LargeLanguageModel

Injectable facade for interacting with an LLM

Result

Represents the result of a decision


This example presents a simplified fraud-detection agent and illustrates how Jakarta Agentic AI integrates with the Jakarta EE programming model. The agent uses the LargeLanguageModel facade for AI interaction and leverages Jakarta Persistence and Jakarta NoSQL to access enterprise data. As a result, AI capabilities are incorporated as part of the application, not as a separate programming environment.

Java
 
@Agent
public class FraudDetectionAgent {

    @Inject
    LargeLanguageModel model;

    @Inject
    EntityManager entityManager;

    @Inject
    Template template;

    @Trigger
    private void handleTransaction(
            @Valid BankTransaction transaction) {
    }

    @Decision
    private Result checkFraud(BankTransaction transaction) {

        CustomerHistory history = template
            .find(CustomerHistory.class, transaction.customerId())
            .orElse(null);

        String output = model.query(
            """
            Analyze this transaction for potential fraud
            using the transaction and customer history.
            """,
            transaction,
            history);

        return new Result(isFraud(output), null);
    }

    @Action
    private void handleFraud(
            Fraud fraud,
            BankTransaction transaction) {

        if (fraud.isSerious()) {
            alertBankSecurity(fraud);
        }
    }

    @Outcome
    private void markTransaction(
            BankTransaction transaction) {

        BankTransaction managed =
            entityManager.merge(transaction);

        managed.markAsSuspect();
    }
}


Conclusion

Enterprise Java is prepared for AI today, with Jakarta EE already supporting this integration. Developers can add AI using provider SDKs, OmniHai, or LangChain4j CDI, while continuing to leverage Jakarta EE features for persistence, security, messaging, transactions, REST APIs, and enterprise data. AI enhances the existing platform as an integrated capability, rather than requiring replacement.

The ecosystem continues to advance. Jakarta EE 12 enhances the data foundation, and Jakarta Agentic AI is introducing a structured programming model for building agents that integrate seamlessly with the platform. Jakarta EE is ready for AI now, and its capabilities will keep improving as the platform evolves.

AI Java (programming language)

Opinions expressed by DZone contributors are their own.

Related

  • Orchestration Meets MCP: Building Governed Agentic Workflows With Quarkus Flow and AGENTS.md
  • AGENTS.md Makes Your Java Codebase AI-Agent Ready
  • Jakarta NoSQL: Why JPA Is Not Enough for the AI Era
  • Implementing the Planning Pattern With Java Enterprise and LangChain4j

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook