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

Posts:3
Registered: 8/3/04
Package does not exist  
Aug 3, 2004 1:37 AM



 
hi, I am having this problem with package import statements:

I have package "org.opencyc.api" in the following directory
C:\opencyc-0.7.0\src\org\opencyc

and "jug.jar " in the C:\opencyc-0.7.0\src\org\opencyc directory.

The I am importing these two packages as

import org.opencyc.api.*;
import jug.jar.*;

My classpath is as follows:
.;D:\j2sdk1.4.2\jre\lib\rt.jar;D:\j2sdk1.4.2\lib\tools.jar;C:\opencyc-0.7.0\src;C:\opencyc-0.7.0\src\org\opencyc\jug.jar;

and for both the import statements I am getting package does not exist as error.

Can anyone explain to me, what am I doing wrong.

thanks.
 

Posts:461
Registered: 9/26/02
Re: Package does not exist  
Aug 3, 2004 6:50 AM (reply 1 of 1)



 
hi, I am having this problem with package import
statements:

I have package "org.opencyc.api" in the following
directory
C:\opencyc-0.7.0\src\org\opencyc

If the package is declared as
package org.opencyc.api;
then the directory structrure needs to be
C:\opencyc-0.7.0\src\org\opencyc\api
That pachage should be stored there and your classpath should point to
C:\opencyc-0.7.0\src\


and "jug.jar " in the C:\opencyc-0.7.0\src\org\opencyc
directory.

import org.opencyc.api.*;
import jug.jar.*;

The jar goes in the classpath. You don't import a jar. You import classes from the jar.
 
This topic has 1 reply on 1 page.