#I can't use framework

1 messages · Page 1 of 1 (latest)

zenith relic
#

Help

lusty flaxBOT
#

<@&987246399047479336> please have a look, thanks.

zenith relic
#

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
lusty flaxBOT
# zenith relic error : ```cmd import org.json.simple.JSONArray; ^ .\MyFr...

Detected code, here are some useful tools:

Formatted code
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
white shell
#

Use maven, and add it as a dependency

zenith relic
#

i use vs code

white shell
#

🤷 , vs code is discouraged, as the java support is meh at best

zenith relic
#

i know this but i cant use this ide in javax.Swing

white shell
#

...yes you can

zenith relic
#

i try

marble silo
#

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

zenith relic
#

i cant add maven but i add jar file

marble silo
#

why not?

zenith relic
#

It doesn't work when you add json-simple with Maven, but it works when you add a jar file

marble silo
#

then you are doing it wrong

zenith relic
#
<?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

marble silo
#

what exactly doesnt work?

zenith relic
#

i have new problem

spiral prawn
white shell
#

@zenith relic , no PM

blissful iron
#

And don't use json simple it's trash

white shell
#

gson if you want it simple