Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I've been able to compile and run Java code just fine, until I implemented JSON. I downloaded json-20180813.jar, and can't get it to be recognised.

My file structure is as follows;

/var/www/html/game/server/ :
build (dir)
run
ClientConnection.java
Main.java
Server.java
Utils.java
/var/www/html/game/server/build/ :
json-20180813.jar
ClientConnection.class
Main.class
Server.class
Utils.class
---

Inside run:
Bash
#!/bin/bash

javac -d build Main.java Server.java ClientConnection.java Utils.java -cp /var/www/html/game/server/build/json-20180813.jar
cd build
java Main


Do you have any idea why this is happening?

What I have tried:

Moving the -cp arg back and forth between java and javac, messing with the path
Posted
Comments
Richard MacCutchan 11-Feb-19 4:23am    
Have you checked that org.json.simple actually exists inside the jar file?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900