Jump to content

import statement problem Java


Recommended Posts

I'm having a problem with both netbeans, jedit and using javac through the command line. Importing classes isn't working. It is working under windows with both Kawa and the SDK.

 

uuInOut is a single class file not a package. The program below illustrates problem. Perhaps I'm doing something stupid and its just driving me nuts!

 

import uuInOut;



class Test{

public static void main(String [] args){

int x;

x= uuInOut.ReadInt();



System.out.println("Number entered was: "+x);

}

}

 

Test.java:2: '.' expected

import uuInOut;

^

Test.java:9: cannot resolve symbol

symbol : variable uuInOut

location: class Test

x= uuInOut.ReadInt();

^

2 errors

Process javac exited with code 1[/code]

Link to comment
Share on other sites

I don't understand this stuff, but I did a Google search and you might find this useful:

 

http://www.mail-archive.com/java-linux@jav...g/msg15185.html

 

The replier mentioned that you have to have a fully qualified class path.

Link to comment
Share on other sites

thanks ramfree17,

 

I think the problem arose because my lectures and practical classes

(and windows compiler) use the jdk 1.3. Using 1.3 importing a class file is ok.

 

Under 1.4 it is no longer permissible to import a class unless the class is in a named package.

 

From

 

http://krypton.mankato.msus.edu/~slack/jav...ook/errors.html

 

A nuisance if you ask me!

 

Steve Scrimpshire Thanks for your input, appreciated.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...