This is a Java code example of how to read from, edit and write back to a JSON file.
- Java JDK +1_181 (with language level +8)
- IntelliJ IDE
- JSON Library found here, or look in the
libsfolder.
- Create a folder called 'whatever you want' or (appropriately named
libs) in the module root (same folder where yoursrcfolder is in) - Copy the library
json-simple-1.1.1.jarinto the folder (created above). - In IntelliJ, go to that file in the Project Browser (Shortcut: Alt + 1)
- Right-click on the folder, and click on "Mark as Library" option.
You can then use any library/jar file in this folder as a library
- [Optional] Create an account (register a student account / ask them for an educational licence: free PRO version)
- Download git version control software
- (Recommended) Downlaod git GUI like GitKraken, its the same as 1. but uses a GUI
- (Beginners to VCS/GIT) Simply download the repository as a ZIP file Master Branch zip, extract and open in IntelliJ
- Clone the repository:
- Click Clone Repository (GUI) using link
https://github.com/cybex-dev/JSONReadWriteExample.git, or - Using Git Bash
- Windows button > search
git bash, hit enter. - Use
cdto browse to directory you want to copy repository to. - Then type in
git clone https://github.com/cybex-dev/JSONReadWriteExample.gitif using git in the cmd/terminal
- Windows button > search
- Click Clone Repository (GUI) using link
- Open repository
- (GUI), or type in
cd .\JSONReadWriteExample, or - cmd/terminal (you can browse around here)
- (GUI), or type in
- Open the repository in IntelliJ