[英]Classpath issue: Gradle not working
Uinsg Gradle on Netbeans 8.02: Uinsg在Netbeans 8.02上的Gradle:
Getting the Java compilation error concerning additional libraries not being automatically added to the classpath. 获取有关未将其他库自动添加到类路径的Java编译错误。
So 所以
import org.apache.poi.hssf.usermodel.HSSFCell;
Produces the error 产生错误
package org.apache.poi.hssf.usermodel does not exist
软件包org.apache.poi.hssf.usermodel不存在
How does one go about fixing this error? 如何解决这个错误?
Edit: The Gradle build file: 编辑:Gradle构建文件:
apply plugin: 'java'
sourceCompatibility = '1.8'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
// NetBeans will automatically add "run" and "debug" tasks relying on the
// "mainClass" property. You may however define the property prior executing
// tasks by passing a "-PmainClass=<QUALIFIED_CLASS_NAME>" argument.
//
// Note however, that you may define your own "run" and "debug" task if you
// prefer. In this case NetBeans will not add these tasks but you may rely on
// your own implementation.
if (!hasProperty('mainClass')) {
ext.mainClass = ''
}
repositories {
mavenCentral()
// You may define additional repositories, or even remove "mavenCentral()".
// Read more about repositories here:
// http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:repositories
}
dependencies {
// TODO: Add dependencies here ...
// You can read more about how to add dependency here:
// http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:how_to_declare_your_dependencies
testCompile group: 'junit', name: 'junit', version: '4.10'
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.