Havnt used java in 3 years or so. Found something I needed to do and thought I had some good old code I could reuse. Got everything working the way I need to but am a little thrown off on how jar imports seem to have changed a bit with the module stuff in this newer version of java since last touching it. Runs fine within eclipse but every time I try to run on command Line I get 12-15 errors. They are all something like this....
Driver.java:5: error: package org.json.simple.parser does not exist
import org.json.simple.parser.ParseException;
^
.\jsonParse.java:10: error: package org.json.simple does not exist
import org.json.simple.JSONArray;
^
.\jsonParse.java:11: error: package org.json.simple does not exist
import org.json.simple.JSONObject;
^
.\jsonParse.java:12: error: package org.json.simple.parser does not exist
import org.json.simple.parser.JSONParser;
^
.\jsonParse.java:13: error: package org.json.simple.parser does not exist
import org.json.simple.parser.ParseException;
^
.\jsonParse.java:17: error: cannot find symbol
public static ArrayList<Products> parser(String url) throws FileNotFoundException, IOException, ParseException {
Obviously its complaining about references to json-simple-1.1.jar but I have that sitting in the referenced Library folder within a java project in eclipse, and it is connected under classpath in run config.
Here is the project structure
In eclipse->
DataFeedProject (c:/myCode/DataFeedProject)
src
driver.java (main)
jsonParser.java
Products.java
apiClient.java
xmlGenerator.java
JRE System Library [JavaSE-17]
Referenced Libraries
json-simple-1.1.jar (c:/myCode)
xmlOutput.xml
productStatus.txt
file explorer -> these four are only visible in file explorer
.settings (containing eclipse resources)
bin (all the .class files eclipse generated)
.classpath
.project
I have spent more time than I would like to admit trying to figure out why I cant get it running from command line. Need a compiled version to send off to server via ssh where I will only be able to run via cmd. Feel like I have exhausted about ever combination of javac -d path -cp path Driver.java etc etc.
Appreciate any help. Thanks