I use jdk17 load graphhopper , when use idea run project is ok , but when package jar , call server will no paths and error

Error: Cannot compile expression, in source: File ‘source’, Line 1, Column 50: A class “com.graphhopper.routing.weighting.custom.CustomWeightingHelper” could not be found

How did you package the jar?

If you do not need to modify the source code you can download the jar as suggested here.

I apologize for any confusion in my previous expression. I have integrated GraphHopper into my Spring Boot project. When I start Spring Boot in IntelliJ IDEA, it works normally. However, when I package it into a JAR file and call the routing service, I encounter the following error:

Cannot compile expression, in source: File ‘source’, Line 1, Column 50: A class “com.graphhopper.routing.weighting.custom.CustomWeightingHelper” could not be found

I’m not sure if this is due to my configuration. I did not use an external yml file but instead loaded GraphHopper directly via JavaBean configuration. My setup is as follows:
private String osmFile;

@Bean
public GraphHopper graphHopper(){
    return initGraphHopper();
}


private GraphHopper initGraphHopper() {
    GraphHopper graphHopper = new GraphHopper();
    graphHopper.setOSMFile(osmFile);
    graphHopper.setGraphHopperLocation("graph_cache");

    CustomModel customModel =   new CustomModel();
    customModel.setDistanceInfluence(90D);
    customModel.addToSpeed(
            Statement.If("true",
                    Statement.Op.LIMIT,
                    "car_average_speed"));
    customModel.addToPriority(Statement.If("!car_access", Statement.Op.MULTIPLY,"0"));
     graphHopper.setProfiles(new Profile("car").setCustomModel(customModel));
    graphHopper.setEncodedValuesString("car_access, car_average_speed");
    graphHopper.setPreciseIndexResolution(500);
    graphHopper.importOrLoad();
    log.info("[init-graph hopper] route server load completed !!!");
    return  graphHopper;
}

}

You’ll need to include the jar via maven or gradle. See the snippet for maven here.

sorry. my bad
The issue has been resolved. I’m not entirely sure if this qualifies as a bug, but the root cause was my use of CompletableFuture , which led to Janino’s reflection failure after Spring Boot packaging. Thank you for your assistance!

Any more details about this? Maybe a reproducer with a simple spring boot project?