Collected the project using Maven turned out the following structure:

enter image description here

In the app folder I have the main classes, in the xslt folder the resources that are needed for the application to work.

The problem is the following if in the IDE you specify the path like this:

File F = new File(Main.class.getResource("../xslt").toString()); 

That folder xslt is correct, but after building and running the JAR, a NullPointerException pops up. How to access another package in a compiled JAR file?

  • one
    The counter question is: how is the jar going and how does it look from the inside? - etki
  • somehow all is not so good looking at you, dropping the entire structure of the project (the folder where pom.xml is + all nested) - jmu

1 answer 1

When building applications using Mavena, packages are usually automatically connected to the application and they are rather simple to import (100% works this way in the idea). Try not to connect them manually, but simply import

  • In this package there are not classes, but just files and I want to understand how in the process of executing the program you can access this package. PS import works only for classes or do I not know something? - Bleser
  • No, I just misunderstood the question - AntiVIRUZ