Project Import

The censhare project is an Eclipse based project, therefore before starting with the import of the project make sure that the “Eclipse Integration” Plugin is enabled in IntelliJ’s preferences:

  • File > Settings (Windows)
  • IntelliJ IDEA > Preferences (OS X)

eclipsePlugin

  • To import the project, click on the “Import” option that appears on the welcome wizard of IntelliJ, and select the local directory of “censhare-product” for import and click “Next”.

welcome

  • On the next step, choose the “Import Project from External model” option and select “Eclipse” as the external model option.

importEclipse

  • At this point, the wizard will ask you to choose between two options on where should IntelliJ place its module files. More information on the two options can be found here.

import2

  • Select an SDK responsible for the project and click “next”. If there are no JDKs appearing in the list, click on the “+” sign on the top right corner to add one. You can choose between using an external JDK of your preference or the JDK that comes with IntelliJ.

SDK

  • Select all desired sub-projects for import and click “next”. Make sure to unselect any projects that might cause a “nested module exception” (see: java and demo-project)

selectProjects

Build

As soon as all desired projects are successfully imported into IntelliJ, you can run a build to verify if there are any other issues or missing dependencies that need to be fixed:

  • Build > Build Project (keyboard shortcut: OS X: cmd+F9 , Windows: ctrl+F9)

In case the build fails with an error similar to this: “Imported projects refer to unknown JDK”:

  • Navigate to File > Project structure, there you will see the available projects and the SDK assigned to it in the “Dependencies” Tab. For any modules that SDK appears in red letters, make sure to choose another SDK from the dropdown list and click on the “Apply” button.

SDKtroubleshooting

Add Debug Configuration

  • Add a debug connection for a Remote Java application by navigating to Run > Edit Configurations
  • Click on the “+” button at the top right corner, and select “Remote”

remote

For additional information on how to work and further optimize IntelliJ, make sure to have a look on Jetbrains’ SDK documentation here.

Add Exports for censhare-Client

Running the Java Client from within IntelliJ requires adding the following JVM options in the module’s compiler settings. These options are used both during compile time and runtime.

  • In Preferences > Build, Execution, Deployment > Java Compiler
  • Uncheck the option “Use ‘–release’ option for cross-compilation (Java 9 and later)”
  • In the “Override compiler parameters per-module” panel, add the censhare-Client module with the following compilation options:

--add-exports
java.desktop/java.awt.peer=ALL-UNNAMED
--add-exports
java.desktop/sun.lwawt=ALL-UNNAMED
--add-exports
java.desktop/sun.lwawt.macosx=ALL-UNNAMED
--add-exports
java.desktop/com.apple.laf=ALL-UNNAMED
--add-exports
java.desktop/sun.awt=ALL-UNNAMED

JavaCompilerOptions

Required plugins

Access the martketplace by going to ‘Preferences…’ ⌘, (command key + coma key) and go to ‘Plugins’. User the search to find the following plugins:

  • JSGraphQL
  • Karma
  • Prettier
  • SassLint
  • No labels