简体   繁体   中英

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 :

Caused by: java.lang.RuntimeException: Uncompilable source code - package org.jfree.chart does not exist at testJfreeChart.(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. It's easy to use and helps you with all the hustle you come across. I don't know what IDE you're using. 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. Maven will download the depencies and everything is done :)

Maven basic pom:
https://maven.apache.org/pom.html#The_Basics
Maven repo link:
http://mvnrepository.com/artifact/org.jfree/jfreechart

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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