Skip to content

setting up an intelliJ dev environment for ilastik4ik

Dominik Kutra edited this page Sep 8, 2020 · 5 revisions

Development Environment Setup

Summary of setting up a development environment for the non-java-aware people (summarizing in-person help by @emilmelnikov) during a tiny ilastik4ij hackathon. Following this allows you to conveniently debug the plugin from within IntelliJ.

  1. Download and install IntelliJ IDEA
  2. Obtain jdk - I'm using conda to manage java versions, so
    conda create -n java -c conda-forge openjdk=8 maven
  3. clone the ilastik4ij repo
    git clone https://github.com/ilastik/ilastik4ij
  4. Open IDEA (if you have installed deps via conda, activate the java environment before starting IDEA from the terminal), import project, point to the ilastik4ij folder.
  5. Get dependency sources and docs: Top right corner of IntelliJ houses the search anything toolbar; type in "Download", choose Download Sources And Documentation.
  6. Go to File -> Project Structure; Click on SDKs, make sure the JAVA 8 sdk is used (for me JDK HOME is /home/MYUSER/miniconda3/envs/java). Make sure this SDK is selected as project SDK and also check that Project Language Level is 8 ....
  7. create a new file in src/main/test/java/org/ilastik/ilastik4ij called DebugIJ.java with the following contents:
    package org.ilastik.ilastik4ij;
    
    import net.imagej.ImageJ;
    
    public class DebugIJ {
        public static void main(String[] args) {
            ImageJ ij = new ImageJ();
            ij.launch(args);
            ij.log().info("Hello from ilastik4ij!");
    
            // ij.command().run(IlastikCommand.class, true);
        }
    }
  8. with this file open click on run to create a new run configuration. If you're successful, ImageJ should start up.
Clone this wiki locally