开发者

Java package does not exist

开发者 https://www.devze.com 2023-04-04 06:03 出处:网络
I am starting to work on legacy project and fighting now with running it on my computer. I have imported it yesterday and everything worked fine, project did build and everyone was happy. Then I had t

I am starting to work on legacy project and fighting now with running it on my computer. I have imported it yesterday and everything worked fine, project did build and everyone was happy. Then I had to install some additional software and had some problems with java jdk and jre paths, but I managed to finish that task and I got back to building the project and I couldn't do it. I have not changed any file in the project, nor any project configuration (I'm using eclipse and build with ant) only changes in system environment were made. It also builds in other team member environment, so it's not the code itself.

error message I get looks like this:

[javac] C:\Users\bilskluc\virtualdisk\blah\xyz\packages\radius\src\com\blah\wfc\radiusinput\RadiusHostEntry.java:9: package com.blah.devkit.exception does not exist
[javac] import com.blah.devkit.exception.DRException;
[javac]                                         ^
[javac] C:\Users\bilskluc\virtualdisk\blah\xyz\packages\radius\src\com\blah\wfc\radiusinput\RadiusHostEntry.java:10: package com.blah.devkit.storable does not exist
[javac] import com.blah.devkit.storable.DRAbstractStorable;
[javac]                                        ^

and so on. It looks exactly the same in eclipse an when I run it from the console. ant packages used are imported with the project and pointed explicitly, also most important env variables are set from configuration file before running the build and the configuration file did not开发者_运维百科 change.

Mentioned packages and classes are in a .jar file included in project.

Did anyone have a similar problem? I have checked everything I could think of. To reduce risk that I changed something I removed all code and download it from svn again (and checked that there were no commits in last few days).

Maybe someone has an idea where I should look for some system configuration changes that could cause this problem.

EDIT

those two libraries are mentioned in .classpath file

<classpathentry kind="lib" path="blah/lib/devkit.jar">
    <attributes>
        <attribute name="javadoc_location" value="jar:platform:/resource/MZ-package-radius/blah/lib/devkit_javadoc.jar!/javadoc"/>
    </attributes>
</classpathentry>
<classpathentry kind="lib" path="blah/lib/picostart.jar"/>

but I don't know ant very well so I don't know if it uses this file to determine classpath or does it use any other setting


Assuming you have your class path set up in your ANT script:

<path id="compile.classpath">
    ...
</path>

You can output the classpath being used by your ANT script by putting something like this inside your target:

<property name="myclasspath" refid="compile.classpath"/>
  <echo message="Classpath = ${myclasspath}"/>


I just figured out a solution that works for me. My libraries were in a "lib" directory. Oddly, moving them to a "libs" directory, re-adding them to the build path in Eclipse, and then updating the project for Ant (android update project --path .) magically started things working again. Perhaps the "libs" folder is special, and it has to be called exactly that?


You can put your jars into build/jar/ folder and then use this path:

<path id="mypath">
    <fileset dir="build/lib">
      <include name="*.jar" />
    </fileset>
</path>
0

精彩评论

暂无评论...
验证码 换一张
取 消