I have downloaded gson.jar from its source.
Right-clicked at libraries folder -> add new -> add jar -> gson.jar
However when i try to use
Gson gson = new Gson();
It complains that it cannot find symbol Gson.
What is the right way how to add gson to the project? I am not using maven
Thanks for help!
Go to Download Gson
There, access last Gson version:
You will see sth like this:
In order to import Gson using netbeans you will need to download 3 files from here:
Then, you have to create a library on netbeans:
It should work now!
I am new to this. I used the same method of import that you used. It told me that it cannot find symbol Gson so I used CTRL+SHIFT+I to import correct library for gson and now everything is ok. You can also add this import statement import com.google.gson.Gson; to the top of the page. I do apologize about the non-technical formatting of this paragraph.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.