Kyle
Kyle

Reputation: 4298

Jar file "cannot find main class" from certain directories, works from others

The problem is in the title - from my Desktop directory my jar file runs fine. From AppData/Roaming directory, it will not run at all and gives the error "cannot find main class". I've verified that the manifest is correct.

Edit: My account has 'full control' permissions on both the directory the file is in and the file itself.

Upvotes: 1

Views: 432

Answers (2)

Kyle
Kyle

Reputation: 4298

Finally figured it out; one of the project dependencies is a .dll file that was not there. Its absence probably led to an exception being thrown before the main class was called, which in turn produced the "cannot find main class" error. Despite the fact that the error message was misleading, including the project dependency fixed the problem..

Upvotes: 0

Dmitry Negoda
Dmitry Negoda

Reputation: 3189

Check if there are read permissions on the jar file in those directories.

Upvotes: 1

Related Questions