我在我的项目中使用稀疏矩阵。为了构建稀疏矩阵,我使用通用 Java 矩阵包。我在我的 pom.xml 文件中添加了所有依赖项。我的 pom.xml 文件就是这样。
<?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>org.ujmp</groupId>
<artifactId>ujmp-core</artifactId>
<version>0.3.0</version>
<dependencies>
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-gui</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-commonsmath</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-complete</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-ehcache</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-ejml</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-elasticsearch</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-examples</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-hadoop</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-itext</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-jackcess</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-jama</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-jblas</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-jdbc</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-jetty</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-jfreechart</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-jmatio</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-jsch</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-jsci</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-jscience</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-jung</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-la4j</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-lucene</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-mail</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-mtj</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-ojalgo</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-parallelcolt</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-pdfbox</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-poi</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-vecmath</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-json</artifactId>
<version>0.3.0</version>
</dependency>
</dependencies>
我自己添加了这个依赖。从 ujmp.org 网站从那里的文档中添加的所有依赖项。添加所有依赖项后,仍然存在一个错误Error:(30, 16) java: package org.json does not exist.Error:(75, 40) java: cannot find symbol
symbol: class JSONTokener
location: class org.ujmp.core.util.JsonUtil. Error:(72, 38) java: cannot find symbol
symbol: class JSONTokener
location: class org.ujmp.core.util.JsonUtil
所以我认为在我的 pom.xml 文件中添加 json 依赖项应该可以消除错误。
<dependency>
<groupId>org.ujmp</groupId>
<artifactId>ujmp-json</artifactId>
<version>0.3.0</version>
</dependency>
但错误没有被删除,版本 0.3.0 无法识别。它以红色标志显示。所以我该怎么做?我正在使用 Intellij Idea。UJMP官网没有为json添加依赖。请给我一个建议。