We present herein a technique of fabricating grating lenses and lenslet arrays on glass by laser direct writing. Computer generated grating patterns with precision of two microns can be written directly on an ion-exchanged glass plate using a visible low-power semiconductor diode laser. The grating lens components produced by this technique have the advantages of compactness and planar integratability with other optoelectronic components. The comparison of theoretical design and experimental results of grating lenses is given. The limitation of this technique is also discussed. Good lens focusing performance is demonstrated. High efficiency gratings lenses and lenslet arrays can find applications in optical interconnection, printing, and computing systems.