Packages

Using the Java SDK with TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
Brian

Packages

Post by Brian »

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...........
Garrett

Re: Packages

Post by Garrett »

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.
Tom

Re: Packages

Post by Tom »

Anyone know how to make the package name into a varialbe like $BaseName?

thanks,
Tom
adrian

Post by adrian »

perfect
Post Reply