---
title: "The type XXX cannot be resolved.It is indirectly referenced from required .class"
author: "yunnick"
date: "2012-06-07T17:44:16Z"
tags: ["It is indirectly referenced from required .class"]
categories: ["编程语言"]
slug: "the-type-xxx-cannot-be-resolved-it-is-indirectly-referenced-from-required-class"
draft: false
lastmod: "2012-06-07T17:44:16Z"
id: 1554664
url: "https://yunnick.iteye.com/blog/1554664"
---

编码时遇到编译错误：

The type XXX cannot be resolved.It is indirectly referenced from required .class

 

字面意思就是：某个类无法被解析，因为它在某个.class文件中是间接引用的。

 

原因：我在工程A里引用了另一个工程B，想使用B中的一个构造方法Con()，而这个方法有是继承了B中的某个jar包里的类，所以报的这个错误。

解决方法：将B里的相关jar文件放到A工程里面，问题解决