Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: use syntax highlighting #812

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,56 +44,56 @@ The org.json package can be built from the command line, Maven, and Gradle. The
**Building from the command line**

*Build the class files from the package root directory src/main/java*
````
```shell
javac org/json/*.java
````
```

*Create the jar file in the current directory*
````
```shell
jar cf json-java.jar org/json/*.class
````
```

*Compile a program that uses the jar (see example code below)*
````
```shell
javac -cp .;json-java.jar Test.java (Windows)
javac -cp .:json-java.jar Test.java (Unix Systems)
````
```

*Test file contents*

````
```java
import org.json.JSONObject;
public class Test {
public static void main(String args[]){
JSONObject jo = new JSONObject("{ \"abc\" : \"def\" }");
System.out.println(jo.toString());
}
}
````
```

*Execute the Test file*
````
```shell
java -cp .;json-java.jar Test (Windows)
java -cp .:json-java.jar Test (Unix Systems)
````
```

*Expected output*

````
```json
{"abc":"def"}
````
```


**Tools to build the package and execute the unit tests**

Execute the test suite with Maven:
```
```shell
mvn clean test
```

Execute the test suite with Gradlew:

```
```shell
gradlew clean build test
```

Expand Down