Neutral beam injection heating has been development for the TJ-II stellarator. The beam has a port-through power between 700-1500 kW and injection energy 40 keV. The sensibility of the injection system to the changes of several parameters is analysed. Beam transmission is limited by losses processes since beam is born into the ions source until is coming into the fusion machine. For the beam transmission optimization several beam diagnostics have been developed. A carbon fiber composite (CFC) target calorimeter has been installed at TJ-II to study in situ the power density distribution of the neutral beams. The thermographic print of the beam can be recorded and analysed in a reliable way due to the highly anisotropic thermal conductivity of the target material. With the combined thermographic and calorimetric measurements it has been possible to determine the power density distribution of the beam. It has been found that a large beam halo is present, which can be explained by the extreme misalignment of the grids. This kind of halo has a deleterious effect on beam transport and must be minimized in order to improve the plasma heating capability of the beams. (Author) 155 refs.