简体   繁体   English

导入库JFreeChart出错(java)

[英]Error import library JFreeChart (java)

I'm trying to make a java application, I need to use JFreeChart library and I impoort it but an error is displayed : 我正在尝试制作一个Java应用程序,我需要使用JFreeChart库,并且对其进行了伪装,但显示了错误:

Caused by: java.lang.RuntimeException: Uncompilable source code - package org.jfree.chart does not exist at testJfreeChart.(testJfreeChart.java:6) 由以下原因引起:java.lang.RuntimeException:无法编译的源代码-testJfreeChart处不存在org.jfree.chart包。(testJfreeChart.java:6)

what i should do ? 我该做什么 ?

I guess you have your imports correct and added the library somehow to your project. 我想您的导入正确无误,并以某种方式将库添加到了项目中。 Then this sounds like a dependency problem. 然后,这听起来像一个依赖性问题。

I would suggest using Maven as a basic tool for dependency management. 我建议使用Maven作为依赖管理的基本工具。 It's easy to use and helps you with all the hustle you come across. 它易于使用,可帮助您解决所有遇到的麻烦。 I don't know what IDE you're using. 我不知道您正在使用什么IDE。 But if it's Eclipse, just add a pom.xml to you project base, convert your project to a Maven Project (right-clicking -> convert -> Maven) and add the jFreeChart dependency. 但是,如果是Eclipse,只需将pom.xml添加到您的项目库中,将您的项目转换为Maven项目(右键单击-> convert-> Maven)并添加jFreeChart依赖项。 Maven will download the depencies and everything is done :) Maven将下载依赖关系,一切都已完成:)

Maven basic pom: Maven基本pom:
https://maven.apache.org/pom.html#The_Basics https://maven.apache.org/pom.html#The_Basics
Maven repo link: Maven回购链接:
http://mvnrepository.com/artifact/org.jfree/jfreechart http://mvnrepository.com/artifact/org.jfree/jfreechart

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM