I have a Java project where I am using json-simple-1.1.1.jar. I'm using IntelliJ and Maven to run my project and I'm using Windows. I set up my classpath for json-simple-1.1.1.jar in my environment variables and I set up the dependencies on IntelliJ. I can run the project just fine if I press the green run button in IntelliJ, but I want to know how to run it in IntelliJ's terminal.
Normally I run my Java file by going to my file's directory and doing a javac MyFile.java
, but I know that I have to add something to the command. I've tried something like javac -cp json-simple-1.1.1.jar MyFile.java
while I'm in the directory of my file but it doesn't work and I keep getting this error package org.json.simple does not exist
.
What terminal command do I use? My actual .jar file for json-simple isn't actually in my project, it's in a different folder in my computer. Would that be contributing to the problem?