#I can't use framework
1 messages · Page 1 of 1 (latest)
<@&987246399047479336> please have a look, thanks.
error :
import org.json.simple.JSONArray;
^
.\MyFrame.java:22: error: package org.json.simple does not exist
import org.json.simple.JSONObject;
^
.\MyFrame.java:95: error: cannot find symbol
JSONArray array = new JSONArray();
^
symbol: class JSONArray
.\MyFrame.java:95: error: cannot find symbol
JSONArray array = new JSONArray();
^
symbol: class JSONArray
.\MyFrame.java:96: error: cannot find symbol
JSONObject object = new JSONObject();
^
symbol: class JSONObject
.\MyFrame.java:96: error: cannot find symbol
JSONObject object = new JSONObject();
^
symbol: class JSONObject
.\MyFrame.java:100: error: cannot find symbol
JSONObject mainobject = new JSONObject();
^
symbol: class JSONObject
.\MyFrame.java:100: error: cannot find symbol
JSONObject mainobject = new JSONObject();
^
symbol: class JSONObject
8 errors
Detected code, here are some useful tools:
import org.json.simple.JSONArray;
^ .\MyFrame.java : 22 : error : package org.json.simple does not existimport org.json.simple.JSONObject;
^ .\MyFrame.java : 95 : error : cannot find symbol JSONArray array = new JSONArray();
^ symbol : class JSONArray.\MyFrame.java : 95 : error : cannot find symbol JSONArray array = new JSONArray();
^ symbol : class JSONArray.\MyFrame.java : 96 : error : cannot find symbol JSONObject object = new JSONObject();
^ symbol : class JSONObject.\MyFrame.java : 96 : error : cannot find symbol JSONObject object = new JSONObject();
^ symbol : class JSONObject.\MyFrame.java : 100 : error : cannot find symbol JSONObject mainobject = new JSONObject();
^ symbol : class JSONObject.\MyFrame.java : 100 : error : cannot find symbol JSONObject mainobject = new JSONObject();
^ symbol : class JSONObject8errors
Use maven, and add it as a dependency
i use vs code
🤷 , vs code is discouraged, as the java support is meh at best
We suggest https://www.jetbrains.com/idea/ or eclipse
i know this but i cant use this ide in javax.Swing
...yes you can
i try
well this problem is kinda unrelated to the ide you use
just use a build tool
like maven or gradle
and add your dependency properly
i cant add maven but i add jar file
why not?
It doesn't work when you add json-simple with Maven, but it works when you add a jar file
then you are doing it wrong
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>Login_Project</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
</dependencies>
</project>```
it's dont work
what exactly doesnt work?
Which one?
@zenith relic , no PM
Then you must have done something wrong
And don't use json simple it's trash
gson if you want it simple