In this section we will detail mechanisms provided by Java2Script plugin for using and distributing java software. How java software components can be distributed so other Java2Script users can use them in their J2S porojects.
Suppose you develop a very useful software component in Java2Script and now you want to distribute so other can use it in their own java2script projects. In normal java project we normally put our .class files inside a .jar (Java ARchive) file, and distribute the .jar. That is enought, but not in a java2script project where, besides .class files you must also can distribute generated javascript files.
Of course you can always distribute your library sources, and let the users import the osources into their own projects, perhaps in differents sourcefolders, but that is generally a good idea when you want to encapsulate your library api and implementation.
Fortunately, Java2Script provide with flexible mechanism of library definition. Also as we will see, Java2Script support for defining how the library must loaded
TODO: talk about j2slib and how swt, junit etc are inside. TODO: talk about .j2x files and package.js files that le definehow alibrary must be loaded. Also, try and if works to dev a library, put it in other folder that j2slib, with a pacakge.js and lib.j2z file, and show how oackage.js is evaluated, and how to use it for loading one, concatenating several files, etcx
TODO: p/d: future extension packer can be mention here for intelligent generattion of big .js file .