Skip to content

Starting ImageJ from Matlab: Java Swing Look and Feel service error #28

@akshay-vedi

Description

@akshay-vedi

Hello all,
I am facing a problem in launching ImageJ from Matlab using IJM. I am getting the following errors on invoking ImageJ with window pop up as false and true respctively.

addpath('/home/wolfgang/Downloads/fiji-linux64/Fiji.app/scripts/');
javaaddpath('/home/wolfgang/Downloads/fiji-linux64/Fiji.app/jars/ij-1.53t.jar');
ImageJ(false);
Error using ImageJ
Java exception occurred:
java.lang.NullPointerException
at net.imagej.matlab.ImageJMATLAB.disableIJExit(ImageJMATLAB.java:247)
at net.imagej.matlab.ImageJMATLAB.launch(ImageJMATLAB.java:156)
at net.imagej.matlab.ImageJMATLAB.start(ImageJMATLAB.java:105)

ImageJ(true);
Error using ImageJ
Java exception occurred:
java.lang.IllegalArgumentException: Invalid look and feel:
at org.scijava.ui.swing.laf.SwingLookAndFeelService.setLookAndFeel(SwingLookAndFeelService.java:124)
at org.scijava.ui.swing.laf.SwingLookAndFeelService.initLookAndFeel(SwingLookAndFeelService.java:85)
at net.imagej.legacy.IJ1Helper.setVisible(IJ1Helper.java:324)
at net.imagej.legacy.ui.LegacyUI.show(LegacyUI.java:132)
at org.scijava.ui.DefaultUIService.showUI(DefaultUIService.java:166)
at org.scijava.ui.DefaultUIService.showUI(DefaultUIService.java:151)
at org.scijava.AbstractGateway.launch(AbstractGateway.java:110)
at net.imagej.Main.launch(Main.java:47)
at net.imagej.matlab.ImageJMATLAB.launch(ImageJMATLAB.java:151)
at net.imagej.matlab.ImageJMATLAB.start(ImageJMATLAB.java:105)
at net.imagej.matlab.ImageJMATLAB.start(ImageJMATLAB.java:92)
Caused by: java.lang.ClassNotFoundException:
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at javax.swing.SwingUtilities.loadSystemClass(SwingUtilities.java:1879)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:582)
at org.scijava.ui.swing.laf.SwingLookAndFeelService.setLookAndFeel(SwingLookAndFeelService.java:118)
... 10 more

I updated the ImageJ plugins URLs. I also referenced matlab and ImageJ to same java versions (1.8.0_202 and 1.8.0_322). I’m using Matlab version 2022b and ImageJ 1.53t on Ubuntu 22.04.1 LTS.

Any kind of help in fixing this is really appreciated. Please let me know if you need any further information.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions