how to compile java and import it as package
hi:
I am new to Java and meet a problem when compiling the codes. The codes are as following:
Code :
import com.testing.simpletest.*;
....
the main problem is I don't know how to include the files in directory and how to combine them into
one package, and how to name the package. Is there any difference between them and .h files in C.
If I use eclipse as IDE, and create my own project, how to import these packages.
Thanks.
Re: how to compile java and import it as package
Create a jar file for the java files that you have(com.testing.simpletest.*.class). Then add the jar file to your eclipse project. Then execute the project.It may work.
Re: how to compile java and import it as package
Java doesn't use header (.h) files, so there is no similarity at all with C in that respect.
If you want to learn about packages, see What Is a Package? and for full details: Creating and Using Packages.