Home arrow static arrow Java Programming [Archive] - Classpathentry in eclipse
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - Classpathentry in eclipse
This topic has 4 replies on 1 page.

Posts:45
Registered: 7/13/04
Classpathentry in eclipse  
Jul 15, 2004 4:04 AM



 
I have a project named SampleHTTP.
under that i have a java file HTTPtest.java and also a HTTPClient folder.HTTPClient folder contains classes HTTPConnection etc.
I want to use HTTPConnection inside HTTPtest. so i included import HTTPClient.* inside HTTPtest.java.
but i get compilation errors like couldnt resolve symbol HTTPConnection
The classpath file is

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path=""/>
<classpathentry kind="src" path=""/>

<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path=""/>
</classpath>
Do i have to change the classpath entry?

Plz suggest me a solution

thank u

 

Posts:21,719
Registered: 98-02-20
Re: Classpathentry in eclipse  
Jul 15, 2004 4:34 AM (reply 1 of 4)



 
Add the external JAR or directory containing class files to your project build path. Right click on the project and follow the menus.

%
 

Posts:45
Registered: 7/13/04
Re: Classpathentry in eclipse  
Jul 15, 2004 4:47 AM (reply 2 of 4)



 
I did include HTTPClient folder to bulid path and classpath file changed as below
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="lib" path="HTTPClient"/>
<classpathentry kind="output" path=""/>
</classpath>

But still there is compilation errors
Error HTTPConnection cannot be resolved HTTPClass.java SampleHTTPproject/pw/http line 164
Help me plz
 

Posts:45
Registered: 7/13/04
Re: Classpathentry in eclipse  
Jul 15, 2004 4:47 AM (reply 3 of 4)



 
I did include HTTPClient folder to bulid path and classpath file changed as below
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="lib" path="HTTPClient"/>
<classpathentry kind="output" path=""/>
</classpath>

But still there is compilation errors
Help me plz
 

Posts:21,719
Registered: 98-02-20
Re: Classpathentry in eclipse  
Jul 15, 2004 4:52 AM (reply 4 of 4)



 
Is HTTPClient a JAR file? That's what kind="lib" is telling me. The path is telling me that it's located at the top of your project directory tree.

If HTTPClient is a .class file, then you've done it wrong. Try again.

You also output your .class files right to the top of the project directory tree.

Personally, I think this is a terrible arrangement. You should figure out a directory structure that keeps your Java source and JAR files away from the generate .class files. A little thought and organization goes a long way here.

%
 
This topic has 4 replies on 1 page.