Difference between revisions of "IDE setup"

From Freeplane - free mind mapping and knowledge management software
m (Dimitry moved page Setup Eclipse for coding to Setup IDE for coding without leaving a redirect)
(eclipse)
Line 1: Line 1:
 
==Pre-requisites==
 
==Pre-requisites==
===Java Version===
+
Freeplane can be developed in Eclipse, IntelliJ and Netbeans and directly imported from gradle files. Configuration and manifest files needed for debugging are created when gradle build is executed.
 +
==Eclipse==
 +
Eclipse can directly import gradle files using buildship plugin. Alternatively eclipse project files can be generated by gradle running command <pre>gradle eclipse</pre>
  
You need to install a JDK (Java Development Kit). The usual JRE needed to run and use Freeplane is not sufficent to make developments on Freeplane.
+
Project freeplane_mac should be only included on Macs.
On Windows and Linux you can use Java Version 6 or later, on MacOS Java 7 or later is required.
 
  
===Eclipse package===
+
After direct import project freeplane_root should be removed.
 
 
Like Freeplane, Eclipse is based on an OSGI kernel. For this reason Eclipse provides very good support for developing OSGI applications:
 
 
 
* All Bundle properties can be managed via the project properties.
 
* One launch configuration for eclipse in the Freeplane sources, <tt>freeplane_devresources/eclipse/freeplane-osgi.launch</tt>, uses Eclipse' standard OSGI implementation.
 
 
 
:''Note:'' Unlike in the "real application" it's necessary to list all plugins to load in the launch configuration. In the regularly deployed application all plugins in the <tt>plugin</tt> subdirectory are loaded. (By the way also the user's Freeplane directory is scanned for plugins in a <tt>plugin</tt> directory if this exists.)
 
 
 
:Therefore you need an eclipse version with Plug-in Development Environment (PDE), for example [http://www.eclipse.org/downloads/eclipse-packages/ Eclipse for eclipse committers]
 
 
 
* For MacOS the 32 bit version should be used.
 
 
 
==Getting Started Working with Freeplane Within the Eclipse IDE==
 
 
 
===Setup===
 
* Grab a copy of the newest version of Eclipse from the [http://www.eclipse.org/downloads Eclipse download page]. You need an eclipse version with Plug-in Development Environment (PDE), for example "Eclipse for RCP and RAP Developers".
 
:If you are running on GNU/Linux, you may need to install the packages "eclipse-pde" (or something like that) and "eclipse-egit".
 
* Specify a path to your JDK in eclipse.ini setting -vm option as described at http://wiki.eclipse.org/Eclipse.ini#Specifying_the_JVM
 
* Install Gradle (for Freeplane >= 1.4)
 
* Follow [[Git howto|Git How To]]:
 
** get the source code of Freeplane,
 
** do a first build,
 
=== Run gradle build generating eclipse project files ===
 
* You need at least gradle 2.x (install a gradle binary distribution if you need to)
 
* Create a full gradle build (necessary to generate MANIFEST.MFs, Eclipse classpaths and meta data and some jars):
 
  $ gradle clean build cleanEclipse eclipse
 
* File->Import...->General->Existing Projects into Workspace->rootDir=your local git checkout->Select all projects->Finish
 
* close the ''freeplane_mac'' project (you may enable this on Mac but it's not currently used)
 
* check that there are no errors in problems tab
 
* Start with freeplane_framework->eclipse->launchers->freeplane-osgi.launch->''right-click''->Run as->freeplane-osgi
 
** '''NOTE''': use freeplane-osgi-mac.launch on mac!
 
(this will also create a shortcut under ''Run configurations'')
 
** prepare Eclipse integration.
 
* Start up Eclipse - It should prompt you for a workspace (this is an area where your projects will be stored). Have this where you set up your git home directory.
 
 
 
===Importing The Projects===
 
Before we can start working with Freeplane we have to "import" it as a new project:
 
* Goto : File -> Import...
 
* Under "General" -> Existing Projects into Workspace
 
* Select root directory should point to the git working directory. At this point a project list should appear.
 
:''Note:'' If you are not developing for Apple Mac you can deselect the freeplane_mac project.
 
* Choose Finish. The projects should be added and the workspace will automatically "build".
 
 
 
===Launching the Project===
 
Now that The project has been imported we need to set up the launcher:
 
* Goto : Run -> Run Configurations
 
* Locate the OSGi Framework entry.
 
:If this entry is not there, the required Plug-in Development Environment (PDE) is missing, see above.
 
* Duplicate configuration freeplane-osgi. Give the new configuration name freeplane-osgi local
 
** For Mac-OS use a special launch configuration for macs called freeplane-osgi-mac
 
* Select Tab "Common" and select "save as local file"
 
* Upon clicking "Run" Freeplane should appear.
 
 
 
You are now ready for development/debugging within Eclipse.
 
 
 
==Settings==
 
In project <tt>freeplane_devresources</tt> you find
 
* some launch configurations for starting the application
 
* eclipse code-templates, formatter and clean-up configuration files which must be used if you contribute your code to the project.
 
 
 
==Version control integration==
 
You can use eclipse git plugin EGit. Look at [[Git howto]] for more information.
 
 
 
==Useful Eclipse plugins==
 
* For properties files, especially for language resources, the [http://propedit.sourceforge.jp/index_en.html Properties Editor plugin] is useful. You can install the Properties Editor plugin directly within Eclipse by [http://propedit.sourceforge.jp/howto_eclipseplugin_install_en.html following these short steps].
 
 
 
==Git Eclipse: troubleshooting==
 
There are 2 commons problems you can be faced to when using Git in Eclipse. Here are the solutions.
 
* '''At Eclipse startup''' if Eclipse displays a warning message "'''EGIT could not defined where git is installed'''", open Eclipse then go to Windows > Preferences > Team > Git > Configuration > Tab 'System Settings' and here in 'Location' you can indicate your Git installation folder. See the following page to [http://freeplane.sourceforge.net/wiki/index.php/Git_howto#Installation_.2F_Configuration install and use Git in Freeplane project].
 
* '''When, in Eclipse, you are running the build.xml''' stored in Freeplane_framework, you receive the following error message "'''[exec] Execute failed: java.io.IOException: Cannot run program "git" (in directory "[Directory]"): CreateProcess error=2, The system cannot find the file specified'''" resulting in a build failed. Then follow these steps in Eclipse: go to Run > External Tools > External Tools Configurations.... Then select the ant file you want to run. Then select the tab 'Environment' and click the 'New...' button to add a new variable. This new variable name should be set to PATH and the value should be the folder where Git is installed, for instance D:\AppsJavaDev\Git\bin.
 
  
 +
There are eclipse launch configurations for debugging in project freeplane_debughelper. Configuration <code>freeplane_debughelper/eclipse/freeplane.launch</code> is the most useful one, configurations <code>freeplane_debughelper/eclipse/freeplane dist.launch</code> and <code>freeplane_debughelper/eclipse/freeplane dist mac.launch</code> are used to launch binary distributions created by gradle build.
 +
 +
==IntelliJ==
 +
==Netbeans==
 
[[Category:Coding]]
 
[[Category:Coding]]

Revision as of 16:13, 26 August 2018

Pre-requisites

Freeplane can be developed in Eclipse, IntelliJ and Netbeans and directly imported from gradle files. Configuration and manifest files needed for debugging are created when gradle build is executed.

Eclipse

Eclipse can directly import gradle files using buildship plugin. Alternatively eclipse project files can be generated by gradle running command

gradle eclipse

Project freeplane_mac should be only included on Macs.

After direct import project freeplane_root should be removed.

There are eclipse launch configurations for debugging in project freeplane_debughelper. Configuration freeplane_debughelper/eclipse/freeplane.launch is the most useful one, configurations freeplane_debughelper/eclipse/freeplane dist.launch and freeplane_debughelper/eclipse/freeplane dist mac.launch are used to launch binary distributions created by gradle build.

IntelliJ

Netbeans