Unable to interact with Image when working with IDE

I have been developing a plugin for ImageJ for the past while and ran into an issue.

When creating a new ImagePlus or Img from within the plugin I cannot interact with this from within the ImageJ GUI that opens. This only occurs when launching the plugin from my IDE (IntelliJ).

My way of launching the Plugin from within the IDE is:

public static void main(String[] args) {
        ImageJ ij = new net.imagej.ImageJ();
        ij.ui().showUI();

        ij.command().run(AngleAnalyzer.class, true);
    }

An older version involved implementing ij.plugin.PlugIn instead of org.scijava.command.Command and then calling:

public static void main(String[] args) {
        new ij.ImageJ();
        IJ.runPlugIn(AngleAnalyzer.class.getName(), "");
    }

Would provide me with a UI where I can interact. Ofcourse this also brings other issues, like not being able to use services correctly.

Is there a way to workaround this issue, or an issue with my workflow?
Being able to save and analyze intermittent work is very useful.