JDK 1.6 error - simple

Please look at below and let me know if some one has solution for this issue.

when the code is trying to import the class directly an error is displayed saying " '.' expected ".

I tires with JDK 1.5 , JDK 1.3 and JDK 1.4 , results are same.. If this is resolved with any updated version of JDK, let me the version(minor) so that i can compile the actual classes of the application.

Example programs:-

X.java: 
public class X{
}
 
Y.java:
package ypkg;
import X;
public class Y{}

Is there any way that Y imports the X class without receive the:

Y.java:3: '.' expected
import X;

Here class X is in default package (actually called unnamed package) and class Y is in a named package (ypkg). An unnamed package class can't be imported in any other package. To import a class in some other named package, that class has to be in some named package.
So you can put class X in some package and then import it.

Classes in unnamed package can ONLY be used by other classes in unnamed package. They are visible to other members of the unnamed package since they
are in the same package, but they are not visible to compilation units in
other packages.

classes X, Y without package name are not getting imported. The error is with JDK 1.6 .. I require the working JDK for this type of importing ? I cannot move the classes and class has to be imported explicitly.

Read this:

Packages

Your code might work if you drop the import statement for the class in the unnamed package. But if it doesn't work, you have code that doesn't conform to the language standard as implemented by the JDK you're trying to use.

That means you change the code or you change the JDK you're using.