Skip to content

java.io.FileNotFoundException when running the packaged JAR but working fine in Eclipse IDE #22570

@ohbus

Description

@ohbus

The file is under src/main/resources/exampleFolder/exampleFile.extension
File database = new File(getClass().getClassLoader().getResource("exampleFolder/exampleFile.extension").getFile());

My application runs file because Eclipse IDE includes that under that cp but when I'm running the packaged jar it is not reading the file.

Please help

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: stackoverflowA question that's better suited to stackoverflow.comstatus: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions