dcsimg
Not able to import a package
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sunitha_Lakkakula
Posted On:   Wednesday, November 28, 2001 12:52 AM

Guru, I have a package 'user' which I want to import in my java file.But when I compile my program I am getting errors like below. LoginManager.java:10: '(' or '[' expected UserCredentials us= new UserCredentials; ^ LoginManager.java:3: package user does not exist import user.*; ^ LoginManager.java:10: cannot resolve symbol symbol : class UserCredentials location: class login.LoginManager UserCredentials us= new UserCredentials; ^ 3 errors where 'UserCredentials' is the name of the class in the package 'user','LoginManager' is the name of the file where I want to import the packag   More>>


Guru,


I have a package 'user' which I want to import in my java file.But when I compile my program I am getting errors like below.




LoginManager.java:10: '(' or '[' expected
UserCredentials us= new UserCredentials;
^


LoginManager.java:3: package user does not exist
import user.*;
^


LoginManager.java:10: cannot resolve symbol
symbol : class UserCredentials
location: class login.LoginManager
UserCredentials us= new UserCredentials;
^
3 errors




where 'UserCredentials' is the name of the class in the package 'user','LoginManager' is the name of the file where I want to import the package.The class and the methods in the package are all declared public.


Hope you can help me soon.


Thanks

   <<Less

Re: Not able to import a package

Posted By:   Krzysztof_Raciniewski  
Posted On:   Thursday, November 29, 2001 12:24 AM

Check your classpath for compiler. The options "-classpath" set the classpath. The example of compiling can look as follow (in Windows environment):


javac -classpath %CLASSPATH%;My_Directory MyProgram.java
About | Sitemap | Contact