Packages
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
Packages
I can compile and even run Java programs, but the compiler will not recognize packages. I cannot import a package I created and I cannot use other classes located inside of a package I created. I included the package <package_name>; header in every different class. Please Help...........
Re: Packages
The problem is that you need to change your working directory and command name. If you have a 2-level package structure, such as:
com.mycompany.MyClass
Then you need to change your working directory from:
$FileDir
to:
$FileDir\..\..
That will drive you two directories up.
Also, you'll need to change the class name parameter sent to java.exe, from:
$BaseName
to:
com.mycompany.$BaseName
That should get it worked out. The problem is that TextPad has no understanding of packages or FQCN's, so you need to hold its's hand through it.
com.mycompany.MyClass
Then you need to change your working directory from:
$FileDir
to:
$FileDir\..\..
That will drive you two directories up.
Also, you'll need to change the class name parameter sent to java.exe, from:
$BaseName
to:
com.mycompany.$BaseName
That should get it worked out. The problem is that TextPad has no understanding of packages or FQCN's, so you need to hold its's hand through it.
Re: Packages
Anyone know how to make the package name into a varialbe like $BaseName?
thanks,
Tom
thanks,
Tom