A method of aligning a lens device with respect to an access port (11, 12) of an optoelectronic component, the method comprising: coupling an optical free-space beam (B1, B2) that propagates along a first direction into the access port (11, 12) of the optoelectronic component; positioning the lens device inside a free-space beam path of the optical free-space beam (B1, B2), the lens device having an adjustment lens (31, 32, 33, 610) that is configured to focus radiation in only a second direction that lies in a plane perpendicular to the first direction; moving the lens device along the second direction to align the adjustment lens with respect to the access port (11, 12) at an initial aligned position at which the optical free-space beam (B1, B2) is one-dimensionally focused by the adjustment lens and at least a portion of a resulting first one-dimensionally focused beam is input into the access port (11, 12); and starting from the initial aligned position, moving the lens device in at least one of the second direction or a third direction to position an optical element (301, 302, 600) of the lens device in front of the access port (11, 12), wherein the third direction is perpendicular to each of the first and second directions (Z, Y), and wherein measurement values provided by a receiving unit (101, 102) of the optoelectronic component (301, 302, 600) are evaluated to determine when the lens device is at the initial aligned position and to determine when the optical element is positioned in front of the access port (11, 12), the measurement values each indicating an amount of radiation being coupled into the access port (11, 12) at a given time. coupling an optical free-space beam (B1, B2) that propagates along a first direction into the access port (11, 12) of the optoelectronic component; positioning the lens device inside a free-space beam path of the optical free-space beam (B1, B2), the lens device having an adjustment lens (31, 32, 33, 610) that is configured to focus radiation in only a second direction that lies in a plane perpendicular to the first direction; moving the lens device along the second direction to align the adjustment lens with respect to the access port (11, 12) at an initial aligned position at which the optical free-space beam (B1, B2) is one-dimensionally focused by the adjustment lens and at least a portion of a resulting first one-dimensionally focused beam is input into the access port (11, 12); and starting from the initial aligned position, moving the lens device in at least one of the second direction or a third direction to position an optical element (301, 302, 600) of the lens device in front of the access port (11, 12), wherein the third direction is perpendicular to each of the first and second directions (Z, Y), and wherein measurement values provided by a receiving unit (101, 102) of the optoelectronic component (301, 302, 600) are evaluated to determine when the lens device is at the initial aligned position and to determine when the optical element is positioned in front of the access port (11, 12), the measurement values each indicating an amount of radiation being coupled into the access port (11, 12) at a given time.