| Importing Packages with Eclipse [message #235601] | 
Tue, 27 April 2004 18:20   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Originally posted by: haatho20.web.de 
 
Hello everybody, 
 
i have the following problem: 
 
I have written a java-Package with lays in the root directory of my eclipse 
project. But Eclipse does not recognize it as a package and each time i want 
to call a method from some of the classes in the package i get an 
errormessage. I included the package properly. When i start the project in 
forte (Sun One ... or something like this) it works. 
 
Can anybody help me ? 
 
Thanks 
 
Thomas
 |  
 |  
  | 
 | 
| Re: Importing Packages with Eclipse [message #236442 is a reply to message #235756] | 
Thu, 29 April 2004 08:52    | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Originally posted by: jm.nospam.steranka.com 
 
In article <c6nvvh$lik$1@eclipse.org>, Marko.Schulz@gmx.de says... 
> In eclipse: Do the directories and .java-Files show up in the Navigator?  
> In the package explorer? With what Icons beside them? A filled or a  
> shaped "J" in a box? The latter would indicate, that eclipse recognizes  
> them as Java-Files but the project isn't set up in a way, that eclipse  
> is supposed to compile and use them. Maybe because the project isn't a  
> Java project, which is indicated by a little J in the project icon. Or  
> the build path isn't set correctly (see the properties of the project  
> and there Java Build Path->Source), since - depending e.g. on how you  
> created the project - sometimes the sources are expected within a folder  
> "src". 
 
Marko, or others, 
(Q) Is there a way to take a project that starts out as a "normal" (non-java) project 
    and change it to a Java project? 
 
(Q) When you are in a Java project, and say "Create package" com.acme.foo, and 
    also say Create Folder com/acme/bar.  What happens differently underneath 
    the covers?   
(A) My guess is that when you create a folder, the folder is added to the 
    "source exclude directories list".  If you add a package this doesn't happen 
    and that is the only difference. 
 
Thanks, 
Patrick Steranka 
 
 
>  
> The project the classes are in show no compilation errors (a little X in  
> a red box in the package explorer) before you want to call a method  
> (which then is shown as anq error, right?)? You want to call the methods  
> from classes within the same project? 
>  
>  > When i start the project in forte (Sun One ... or something like  
> this) it works. 
>  
> Yes, that is not surprising. Forte is another Java-IDE, just like  
> eclipse can be used as one. What do you expect, if it is correctly  
> configured? 
>  
> marko 
>
 |  
 |  
  | 
| Re: Importing Packages with Eclipse [message #236932 is a reply to message #236442] | 
Thu, 29 April 2004 12:59   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Originally posted by: Marko.Schulz.gmx.de 
 
Patrick Steranka wrote: 
>  
> (Q) Is there a way to take a project that starts out as a "normal" (non-java) project 
>     and change it to a Java project? 
 
I would just start a new project and copy the contents over from the  
old. But it might (read: on your own risk) also work if you just edit  
the File .project and change these lines 
 
	<buildSpec> 
	</buildSpec> 
	<natures> 
	</natures> 
 
to these lines 
 
	<buildSpec> 
		<buildCommand> 
			<name>org.eclipse.jdt.core.javabuilder</name> 
			<arguments> 
			</arguments> 
		</buildCommand> 
	</buildSpec> 
	<natures> 
		<nature>org.eclipse.jdt.core.javanature</nature> 
	</natures> 
 
while eclipse is not running.
 |  
 |  
  | 
Powered by 
FUDForum. Page generated in 0.04511 seconds