Java 为JReddit导入Jar文件时出错
我在尝试导入Jreddit运行所需的jar文件时出错 在jreddit的github页面上,它说 依赖关系 简单JSON ApacheHttpComponents ApacheCommonsIO 在访问Maven repository网站之后,我从以下链接下载jar文件 将它们导入我的intellij项目 ⌘ + ; 在MacOSX上→ 模块→ 依赖关系→ 添加→ 项目库→ 装罐 我得到以下错误。。。Java 为JReddit导入Jar文件时出错,java,maven,intellij-idea,reddit,jreddit,Java,Maven,Intellij Idea,Reddit,Jreddit,我在尝试导入Jreddit运行所需的jar文件时出错 在jreddit的github页面上,它说 依赖关系 简单JSON ApacheHttpComponents ApacheCommonsIO 在访问Maven repository网站之后,我从以下链接下载jar文件 将它们导入我的intellij项目 ⌘ + ; 在MacOSX上→ 模块→ 依赖关系→ 添加→ 项目库→ 装罐 我得到以下错误。。。 错误消息是:无法解析符号。我是JREDIT的当前管理员 首先,我认为您使用的是jRed
错误消息是:无法解析符号。我是JREDIT的当前管理员 首先,我认为您使用的是jReddit的旧版本。从外观上看,您使用的是第一个版本
1.0.0
。当前版本为1.0.2
。尝试从下载jar
其次,我的建议是使用maven而不是通过手动导入jar来包含依赖关系
我已经为您创建了一个小pom.xml如何创建一个简单的maven项目:
<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.yourcompany.test</groupId>
<artifactId>jreddit-testing</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>jreddit-testing</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.github.jreddit</groupId>
<artifactId>jreddit</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
4.0.0
com.yourcompany.test
我是JREdit的当前负责人
首先,我认为您使用的是jReddit的旧版本。从外观上看,您使用的是第一个版本1.0.0
。当前版本为1.0.2
。尝试从下载jar
其次,我的建议是使用maven而不是通过手动导入jar来包含依赖关系
我已经为您创建了一个小pom.xml如何创建一个简单的maven项目:
<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.yourcompany.test</groupId>
<artifactId>jreddit-testing</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>jreddit-testing</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.github.jreddit</groupId>
<artifactId>jreddit</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
4.0.0
com.yourcompany.test
我是JREdit的当前负责人
首先,我认为您使用的是jReddit的旧版本。从外观上看,您使用的是第一个版本1.0.0
。当前版本为1.0.2
。尝试从下载jar
其次,我的建议是使用maven而不是通过手动导入jar来包含依赖关系
我已经为您创建了一个小pom.xml如何创建一个简单的maven项目:
<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.yourcompany.test</groupId>
<artifactId>jreddit-testing</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>jreddit-testing</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.github.jreddit</groupId>
<artifactId>jreddit</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
4.0.0
com.yourcompany.test
我是JREdit的当前负责人
首先,我认为您使用的是jReddit的旧版本。从外观上看,您使用的是第一个版本1.0.0
。当前版本为1.0.2
。尝试从下载jar
其次,我的建议是使用maven而不是通过手动导入jar来包含依赖关系
我已经为您创建了一个小pom.xml如何创建一个简单的maven项目:
<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.yourcompany.test</groupId>
<artifactId>jreddit-testing</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>jreddit-testing</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.github.jreddit</groupId>
<artifactId>jreddit</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
4.0.0
com.yourcompany.test
jars似乎不包含此类,或者您为错误的模块添加了此类。为什么不创建maven项目并在pom.xml中添加所有这些依赖项呢?我以前从来没有做过,你有什么推荐的教程吗?maven:IDEA maven:看起来JAR不包含这个类,或者你为错误的模块添加了它。为什么不创建maven项目并在pom.xml中添加所有这些依赖项呢?我以前从来没有做过,你有什么推荐的教程吗?maven:IDEA maven:看起来JAR不包含这个类,或者你为错误的模块添加了它。为什么不创建maven项目并在pom.xml中添加所有这些依赖项呢?我以前从来没有做过,你有什么推荐的教程吗?maven:IDEA maven:看起来JAR不包含这个类,或者你为错误的模块添加了它。为什么不创建maven项目并在pom.xml中添加所有这些依赖项?我以前从未做过,你推荐过任何教程吗?maven:IDEA maven:嘿,谢谢你的回答,我遇到了一个小问题,在运行mvn clean install之后,它下载的包很好,但是当我运行这个程序时,我得到了一个错误:java:directory not found:/Users/“myname”/Documents/workspace/jredditesting/target/generated sources/annotations在从intellij改为eclipse之后,我让它开始工作了,现在我想知道如何检索提交世界新闻subreddit的前10条评论?嘿,谢谢你的回答,我遇到了一个小问题,在运行mvn clean install之后,它可以很好地下载软件包,但是当我运行程序时,我得到了错误:java:directory not found:/Users/“myname”/Documents/workspace/JredDitterSting/target/generated sources/Annotations从intellij改为eclipse后,我让它开始工作,现在我想知道如何检索提交《世界新闻》subreddit的前10条评论?嘿,谢谢你的回答,在运行mvn clean install之后,我遇到了一个小问题,它可以很好地下载软件包,但是当我运行程序时,我得到了错误:java:directory not found:/Users/“myname”/Documents/workspace/jredditesting/target/generated sources/annotations从intellij更改为eclipse后,我让它开始工作,现在,我想知道如何检索提交世界新闻subreddit的前10条评论?嘿,谢谢你的回答,我遇到了一个小问题,在运行mvn clean install后,它可以很好地下载软件包,但是当我运行程序时,我得到了错误:java:directory not found:/Users/“myname”/文档/workspace/jredditesting/target/generated sources/annotations从intellij改为eclipse后,我让它开始工作,现在我想知道如何检索世界新闻subreddit提交的前10条评论?