Line Segment Detector

I want to use LineSegmentDetector in my Java program. But it has been removed from certain OpenCV versions. I tried using the latest version (4.7.0), it doesn’t work in this version. I tried using version 3.2, it doesn’t work. Is there any fix where I can use it in my Java program? (I am using gradle)

it should be here LineSegmentDetector (OpenCV 4.7.0 Java documentation)

Yes, I had checked that. It mentions that the LSD class has been restored in the 4.7.0 version. But when I include "implementation “org.openpnp:opencv:4.7.0-0”
in the dependencies of build.gradle file, this LSD class doesn’t work. It says cannot find symbol Imgproc.LineSegmentDetector.