I'm getting a
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/image/codec/jpeg/JPEGImageDecoder
When using the ICEPDF like it's used here Java PDF Viewer
It has worked previously, there's been no change in any code of this part of the project, since we've been busy with other parts and I've also reset it, didn't fix the issue. Now the first thing I tried after realising it's part of the jre and is also included in my jre, was updating the version since it's not the latest version. That gave me another issue, namely a fieldnotfound exception.
Exception in thread "main" java.lang.NoSuchFieldError: BORDER_STYLE_SOLID
The right jars are included as stated in the stackoverflow post (iceviewer & the core one).
public PdfViewer(String path){
SwingController controller = new SwingController();
SwingViewBuilder factory = new SwingViewBuilder(controller);
JPanel viewerComponentPanel = factory.buildViewerPanel();
controller.getDocumentViewController().setAnnotationCallback(
new org.icepdf.ri.common.MyAnnotationCallback(
controller.getDocumentViewController()));
JFrame applicationFrame = new JFrame();
applicationFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
applicationFrame.getContentPane().add(viewerComponentPanel);
controller.openDocument(path);
applicationFrame.pack();
applicationFrame.setVisible(true);
}