I have Java classes already. Each has a package statement. They compile just fine outside of Eclipse.
I now wish to create a new project in Eclipse and not alter the package statements in these Java classes. How do I do that?
Here are the things I want Eclipse to accept as-is:
Source file: C:\jed\prog\utils\XYZ.java
package prog.utils;
class XYZ {}
CLASSPATH includes C:\jed (the root of the package--yes, this compiles just fine outside of Eclipse)
The Eclipse issue I'm facing: Eclipse flags my package statement as an error. It gives me two choices: move my files into a new nested directory named after my package (nope, wrong solution) or delete the package statement (nope, wrong solution).
I want the new project to use the *.java files in C:\jed\prog\utils ... files with "package prog.utils".
These current definitions do NOT work:
.classpath (currently in the "utils" folder):
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path=""/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="C:/jed"/>
<classpathentry kind="output" path="bin"/>
</classpath>
.project (currently in the "utils" folder):
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Utils</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Ideas?
Thanks!