无法构建 Java Netbeans 项目



几天前,我在构建项目时没有遇到任何问题。但是突然我不能访问lib目录(SchoolManagement/SchoolManagement/dist/lib)。我甚至不能删除lib目录。显示错误"Access Denied!"

输出日志显示:

    ant -f C:\Users\Dinesh\Dropbox\SchoolManagement\SchoolManagement -   Dnb.internal.action.name=rebuild clean jar
    init:
    deps-clean:
    Deleting directory    C:UsersDineshDropboxSchoolManagementSchoolManagementbuild
    clean:
    init:
    deps-jar:
    Created dir: C:UsersDineshDropboxSchoolManagementSchoolManagementbuildclasses
    Created dir: C:UsersDineshDropboxSchoolManagementSchoolManagementbuildempty
    Created dir: C:UsersDineshDropboxSchoolManagementSchoolManagementbuildgenerated-sourcesap-source-output
    Compiling 14 source files to C:UsersDineshDropboxSchoolManagementSchoolManagementbuildclasses
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    Copying 2 files to C:UsersDineshDropboxSchoolManagementSchoolManagementbuildclasses
compile:
    Copying 1 file to C:UsersDineshDropboxSchoolManagementSchoolManagementbuild
    Copy libraries to C:UsersDineshDropboxSchoolManagementSchoolManagementdistlib.
C:UsersDineshDropboxSchoolManagementSchoolManagementnbprojectbuild-impl.xml:993: The following error occurred while executing this line:
C:UsersDineshDropboxSchoolManagementSchoolManagementnbprojectbuild-impl.xml:837: 
java.lang.NullPointerException
    at org.apache.tools.ant.util.ResourceUtils.copyResource(ResourceUtils.java:439)
    at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:559)
    at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:519)
    at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:480)
    at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:443)
    at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:409)
    at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:384)
    at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:322)
    at org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs.execute(CopyLibs.java:206)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor103.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor103.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:396)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor103.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:435)
    at org.apache.tools.ant.Target.performTasks(Target.java:456)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
    at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:286)
    at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:555)
    at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
BUILD FAILED (total time: 28 seconds)

好吧,首先我们可能需要看到确切的代码行,以防有一个空指针错误,但这可能是由于无法访问您的目录,这取决于您的Netbeans对C:/驱动器的权限。

可能的解决方案

如果Netbeans不能删除目录,你可能想尝试以管理员身份运行Netbeans以获得所需的特权(右键单击并以admin身份运行),然后它可能会起作用。似乎还有一个空指针异常,但这可能是因为缺乏权限

其他解决方案

由于这是一个学校的项目,如果你在学校的电脑上运行,我将假设在某种程度上,他们可能给了你一个没有提升特权的帐户,这可能是问题所在,你可以尝试手动将文件复制到一个新的位置,你的帐户确实有读/写的特权。

相关内容

  • 没有找到相关文章