The optical design of the Moons And Jupiter Imaging Spectrometer (MAJIS), is discussed. MAJIS is a compact visible and near-infrared imaging spectrometer covering the spectral range from 0.5 to 5.54 μm (split into two channels), designed for the Jupiter Icy moons Explorer (JUICE) mission. The MAJIS optical layout is constituted by a TMA telescope shared between the two channels, as well as the slit and a collimator, a dichroic filter that splits the light between the channels (VIS-NIR and IR), each one endowed with its own grating, objective and detector. A flat mirror mounted in a Scan Unit before the telescope allows scanning the line of sight in a direction perpendicular to the slit. The collimator has a Schmidt off-axis configuration, with a specular correcting plate for each channel (the dichroic is inserted between the collimator primary mirror and the correcting plate). With the same conceptual layout in both channels, the collimated light is reflected by a flat ruled grating and crosses a completely dioptric objective. The objectives have the same focal length of the collimator, so both spectrometers have unitary magnification. A linear variable order rejection filter is placed in front of the detector so to reject the higher orders dispersed by the grating. A calibration unit allows radiometric and spectral calibration of both channels, with an incandescent lamp and a black body illuminating a common diffuser. Calibration is realized thanks to an extra-rotation of the Scan Unit. The developed design is optimized to work at cryogenic temperatures, with a good optical quality along the whole FOV and a good correction for transverse chromatic aberration and distortions.