Make a .java file Portable -


i writing source code library supposed included in various different projects. ideally can include library different projects, gets me 'package' statement in library.

if specify package my_package, end assuming directory structure. each project has different directory structures. makes impossible incorporate different projects.

you misunderstand how libraries used in java.

you not copy source code of library whatever project want use on. library separate project compiled jar file, , in projects want use library put jar file library on classpath.

for project uses library, doesn't matter package library in. long jar on classpath, can import classes library.

there many thousands of free , open source libraries java available, , project uses multiple third-party libraries.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -