JDK-4496720 : cannot import class file without package settings
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 1.4.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2001-08-27
  • Updated: 2001-08-27
  • Resolved: 2001-08-27
Related Reports
Duplicate :  
Description

Name: bsC130419			Date: 08/27/2001


java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)

I have 2 java source files(listed below). One without
package setting, and another has package setting. When
I try to import the class file without package setting.
It caused a error during compilation. The error message
is

test2.java:2: '.' expected
import test1;

I've try to compile it on jdk1.3.1, it pass without any
error.

------------------------------------------------------
[test1.java]
public class test1{
}

[test2.java]
package test;
import test1;
public class test2{
    public static void main(String[] args){
         test1 t1=new test1();
    }
}
(Review ID: 130700) 
======================================================================