Nanoindenter has been used to directly indent on the cantilever beam to measure Young's modulus such that the substrate effects can be avoided. However, the deflections of cantilever beam are indirectly extracted from the displacement of nanoindenter and therefore their measurement results are easily influenced by local behaviors around the indentation. In this paper, to the authors' best knowledge, this is the first time that the nanoindenter is integrated with an optical system to measure Young's modulus of cantilever beam. The deflection of cantilever beam is directly measured from a specially designed optical system. The influences of substrate effects and local behaviors around indentation are simultaneously avoided from the proposed methodology.