How to import a class from default package

Posted by mykhaylo on Stack Overflow See other posts from Stack Overflow or by mykhaylo
Published on 2010-02-03T15:54:26Z Indexed on 2010/03/14 10:05 UTC
Read the original article Hit count: 302

Hi,

I am using Eclipse 3.5 and I have created a project with some package structure along with the default package. I have one class in default package - Calculations.java and I want to make the use of that class in any of the package (for instance in com.company.calc). When I try to make the use of the class which is default package, its giving me compile error. Its not able to recognise the class in default package. Where is a problem?

Calculations.java - source code

public class Calculations{
native public int Calculate(int contextId);
native public double GetProgress(int contextId);
static 
{
      System.loadLibrary("Calc");
}
}

I can put my class in any other package. This class has some native method which is implemented in Delphi . If I put that class in any of the folder,I will have to make the change that DLL which I want to avoid(really - I can not). Thats why I put my class in the default package.

© Stack Overflow or respective owner

Related posts about java

Related posts about jni