Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.x: MP quickstart fails to start: Error: Could not find or load main class #8464

Closed
barchetta opened this issue Mar 8, 2024 · 2 comments
Closed
Assignees
Labels
2.x Issues for 2.x version branch archetypes bug Something isn't working P1
Milestone

Comments

@barchetta
Copy link
Member

barchetta commented Mar 8, 2024

Environment Details

  • Helidon Version: 2.6.6-SNAPSHOT
  • Helidon MP
  • JDK version:
    java 11.0.11 2021-04-20 LTS
    GraalVM 21.3.0 Java 11 CE (Java Version 11.0.13+7-jvmci-21.3-b05)

Problem Description

If you build quickstart-mp that is generated from the Helidon archetype the resulting application jar won't run:

java -jar target/quickstart-mp.jar
Error: Could not find or load main class me.jdipol.mp.quickstart
Caused by: java.lang.ClassNotFoundException: me.jdipol.mp.quickstart

This is working with Helidon 2.6.5

Steps to reproduce

Build the archetype in the helidon-2.x branch and run:

helidon init --reset --reset --url file:///path/to/helidon-2.x-repo/archetypes/catalog/target/cli-data
# Select MP, quickstart and accept other defaults
mvn clean install 
java -jar target/quickstart-mp.jar

Note: to run the helidon CLI this way you'll want the change in PR #8463

@barchetta barchetta added bug Something isn't working P2 2.x Issues for 2.x version branch native-image archetypes labels Mar 8, 2024
@barchetta barchetta added this to the 2.6.6 milestone Mar 8, 2024
@barchetta
Copy link
Member Author

barchetta commented Mar 8, 2024

This might be related to #8332

The mainClass property in the pom.xml is not set correctly:

        <properties>
            <mainClass>me.jdipol.mp.quickstart</mainClass>
        </properties>

@barchetta barchetta changed the title 2.x: MP quickstart fails to build native-image: Main entry point class not found 2.x: MP quickstart fails to start: Error: Could not find or load main class Mar 8, 2024
@tvallin
Copy link
Member

tvallin commented Mar 11, 2024

fixed by #8465

@tvallin tvallin closed this as completed Mar 11, 2024
@m0mus m0mus added this to Backlog Aug 12, 2024
@m0mus m0mus moved this to Closed in Backlog Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Issues for 2.x version branch archetypes bug Something isn't working P1
Projects
Archived in project
Development

No branches or pull requests

2 participants