Java 使用外部 jar 编译:找不到符号

Java compilation with external jars: cannot find symbol

我正在尝试像这样编译一个 war 项目

javac -classpath "/home/user/gwt-2.8.2/*:/home/user/externalJars/*:/home/user/myapp/src:/home/user/myapp/lib/*" -d build $(find * | grep "\.java")

但是它抛出一个错误

myapp/src/com/myorg/webservices/server/service/reports/jfreeCustomizers/barChart/BarChartHelper.java:15: error: cannot find symbol
import org.jfree.chart.StandardChartTheme;
                      ^
  symbol:   class StandardChartTheme
  location: package org.jfree.chart
myapp/src/com/myorg/webservices/server/service/reports/jfreeCustomizers/barChart/BarChartHelper.java:21: error: cannot find symbol
import org.jfree.chart.renderer.category.StandardBarPainter;
                                        ^
  symbol:   class StandardBarPainter
  location: package org.jfree.chart.renderer.category
myapp/src/com/myorg/webservices/server/service/reports/jfreeCustomizers/stackedAreaChart/TotalComparisonHelper.java:42: error: cannot find symbol
import org.jfree.chart.renderer.category.StandardBarPainter;
                                        ^
  symbol:   class StandardBarPainter
  location: package org.jfree.chart.renderer.category
myapp/src/com/myorg/webservices/server/service/reports/jfreeCustomizers/stackedAreaChart/NetSavingsHelper.java:18: error: cannot find symbol
import org.jfree.chart.StandardChartTheme;
                      ^
  symbol:   class StandardChartTheme
  location: package org.jfree.chart
myapp/src/com/myorg/webservices/server/service/reports/jfreeCustomizers/stackedAreaChart/TotalComparisonHelperV2.java:33: error: cannot find symbol
import org.jfree.chart.renderer.category.StandardBarPainter;
                                        ^
  symbol:   class StandardBarPainter
  location: package org.jfree.chart.renderer.category
5 errors

这很奇怪,因为我在 /home/user/externalJars/ 目录中有 jcommon-1.0.8.jarjfreechart-1.0.7.jar。 编译不干净可能是什么原因?

javac -version
javac 11.0.2
java -version
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-2ubuntu0.18.04.1-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

我相信 jfreechart Jar 是旧版本。 class StandardChartTheme 是在 1.0.11 中引入的(根据链接的 Javadoc),而您使用的是 1.0.7.