From 90b286cd3423889180ad2fa979231a4cadfbebd3 Mon Sep 17 00:00:00 2001 From: Martin Harris Date: Mon, 29 Sep 2014 14:51:51 +0100 Subject: [PATCH 1/2] Adds basic instructions for setting up IDEA Intelli-J, and also some debugging tips --- docs/dev/build/ide.md | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/docs/dev/build/ide.md b/docs/dev/build/ide.md index 07e81571de..9a126ac0ff 100644 --- a/docs/dev/build/ide.md +++ b/docs/dev/build/ide.md @@ -82,14 +82,31 @@ If the pain starts to be too much, come find us on IRC #brooklyncentral or [else -## Intelli-J IDEA - -Many of our contributers prefer Intelli-J. However none of them have yet volunteered any set-up tips. -[Be the first!]({{site.url}}/dev/tips/update-docs.html) +## IntelliJ IDEA +To develop or debug Brooklyn in IntelliJ, you will need to ensure that the Groovy and TestNG plugins are installed +via the IntelliJ IDEA | Preferences | Plugins menu. Once installed, you can open Brooklyn from the root folder, +(e.g. ``~/myfiles/brooklyn``) which will automatically open the subprojects. ## Netbeans Tips from Netbeans users wanted! + + +## Debugging Tips + +To debug Brooklyn, create a launch configuration which launches the ``BrooklynJavascriptGuiLauncher`` class. NOTE: You may +need to add additional projects or folders to the classpath of the run configuration (e.g. add the brooklyn-software-nosql +project if you wish to deploy a MongoDBServer). + +To debug the jsgui (the Brooklyn web console), you will need to build Brooklyn with -DskipOptimization to prevent the build from minifying the javascript. +When building via the command line, use the command ``mvn clean install -DskipOptimization``, and if you are using IntelliJ IDEA, you can add the option +to the Maven Runner by clicking on the Maven Settings icon in the Maven Projects tool window and adding the ``skipOptimization`` property with no value. + +When running at the command line you can enable remote connections so that one can attach a debugger to the Java process: + Run Java with the following on the command line or in JAVA_OPTS: ``-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005`` + +To debug a brooklyn instance that has been run with the above JAVA_OPTS, create a remote build configuration (IntelliJ - +Run | Edit Configurations | + | Remote) with the default options, ensuring the port matches the address specified in JAVA_OPTS. From b95c8072508f5b0ed211130928cefa5093639fc4 Mon Sep 17 00:00:00 2001 From: Martin Harris Date: Thu, 2 Oct 2014 14:37:55 +0100 Subject: [PATCH 2/2] Adds resolution to IntelliJ compilation issue, with reply from JetBrains --- docs/dev/build/ide.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/dev/build/ide.md b/docs/dev/build/ide.md index 9a126ac0ff..5f5c1067fd 100644 --- a/docs/dev/build/ide.md +++ b/docs/dev/build/ide.md @@ -88,6 +88,15 @@ To develop or debug Brooklyn in IntelliJ, you will need to ensure that the Groov via the IntelliJ IDEA | Preferences | Plugins menu. Once installed, you can open Brooklyn from the root folder, (e.g. ``~/myfiles/brooklyn``) which will automatically open the subprojects. +There have previously been issues where the java 6 compiler incorrectly identified the return type of functions that use +generics. These issues have been refactored away, however may return in future. If so, you can either set the java compiler +level to 1.7, or setup IntelliJ to use the Eclipse compiler as per the instructions provided by JetBeans: + +> The problem seems to be caused by bug in java compiler from JDK 1.6, it is known to sometimes produce compilation +> errors for complicated code involving generic types. Java compiler from JDK 1.7 compiles your code successfully so I would +> recommend you to consider upgrading to JDK 1.7. If it isn't possible you can switch to Eclipse Compiler (Settings | +> Compiler | Java Compiler | "Use Compiler" combobox). + ## Netbeans