0

I am trying to run my .jar from cmd but it returns the error ClassNotFoundException. If looked into other questions on StackOverflow but couldnt find a working solution for me. All the questions were using a package which I dont.

My command looks like this:

java -cp Path\To\My\Jar\Formatter.jar Formatter.java

In my folder there is the Formatter.jar and Formatter.java no .class I have tried my command in PowerShell and it works just fine...

EDIT: Fixed typos

  • 1
    Do you want to run the jar-file or the Formatter.java file? For running the jar file see here: https://stackoverflow.com/questions/5774970/run-jar-file-in-command-prompt – HectorLector Sep 18 '20 at 08:37

1 Answers1

1

Open the jar folder where the file is stored -> clear the directory panel at the top and type cmd. > the cmd will open -> then type : java -jar formatter.jar