I have a task to do so that the application would be launched with the command:
java –jar tracker.jar.
I added a menifest from https://maven.apache.org/plugins/maven-shade-plugin/examples/executable-jar.html
But I still write:
Mac-mini-Pavel:tracker pavel$ java –jar tracker.jar Error: Could not find or load main class –jar I in this block from the original on the site changed only this line
<mainClass>ru.pravvich.start.StartUI</mainClass> The rest left as it was. Tell me maybe you need to add something else? In general, my manifesto looks like this:
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>2.4.3</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <mainClass>ru.pravvich.start.StartUI</mainClass> </transformer> </transformers> </configuration> </execution> </executions> </plugin> </plugins> </build> 





-jarinstead of–jar. - Romantracker.jar. Is this file in the current folder? Did you build through maven? Keep in mind, maven places the finished jar in thetargetfolder, not the current one. - Roman