Thermostat/DevelopmentSetupFedora

From IcedTea

Jump to: navigation, search

Back to Thermostat Home

Contents

1 Building Thermostat on Fedora

Before you start setting up your development environment please make sure a recent development snapshot builds on your machine. Please see the README for most recent build instructions. For Fedora the basic steps are as follows:

$ sudo yum install mercurial maven mongodb-server java-1.8.0-openjdk-devel libgnome-keyring-devel make gcc gtk2-devel automake
$ hg clone http://icedtea.classpath.org/hg/thermostat
$ cd thermostat
$ mvn clean package

This will install build required packages and will build the latest dev version of thermostat (and will run tests along the way). After a successful build the output should look similar to this:

---->8-------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] Thermostat ........................................ SUCCESS [2.972s]
[INFO] Thermostat Annotations ............................ SUCCESS [3.214s]
[INFO] Thermostat Keyring API ............................ SUCCESS [3.663s]
[INFO] Thermostat Common ................................. SUCCESS [0.004s]
[INFO] Thermostat Common Core ............................ SUCCESS [2.744s]
[INFO] Thermostat Common Test ............................ SUCCESS [0.878s]
[INFO] Thermostat Storage (DB) Drivers ................... SUCCESS [0.003s]
[INFO] Thermostat Storage Core ........................... SUCCESS [1.686s]
[INFO] Thermostat Launcher ............................... SUCCESS [1.180s]
[INFO] Thermostat Main ................................... SUCCESS [0.933s]
[INFO] Thermostat Client ................................. SUCCESS [0.004s]
[INFO] Thermostat Client Core ............................ SUCCESS [1.690s]
[INFO] Swing Components and Utilities .................... SUCCESS [0.720s]
[INFO] Thermostat Swing Client ........................... SUCCESS [3.527s]
[INFO] Thermostat Command Channel Common Library ......... SUCCESS [1.558s]
[INFO] Thermostat Command Channel Client ................. SUCCESS [1.791s]
[INFO] Thermostat Process handler plugin ................. SUCCESS [0.751s]
[INFO] Thermostat CLI Client Commands .................... SUCCESS [1.134s]
[INFO] Thermostat Host Overview plugin ................... SUCCESS [0.003s]
[INFO] Thermostat Host Overview Core Client plugin ....... SUCCESS [1.041s]
[INFO] Thermostat Host Overview Swing Client plugin ...... SUCCESS [0.764s]
[INFO] Thermostat Host CPU plugin ........................ SUCCESS [0.002s]
[INFO] Thermostat Host CPU Common plugin ................. SUCCESS [0.540s]
[INFO] Thermostat Host CPU Core Client plugin ............ SUCCESS [0.945s]
[INFO] Thermostat Host CPU Swing Client plugin ........... SUCCESS [1.403s]
[INFO] Thermostat Agent .................................. SUCCESS [0.003s]
[INFO] Thermostat Agent Core ............................. SUCCESS [2.008s]
[INFO] Thermostat Host CPU Agent plugin .................. SUCCESS [0.734s]
[INFO] Thermostat Host Memory plugin ..................... SUCCESS [0.002s]
[INFO] Thermostat Host Memory Common plugin .............. SUCCESS [0.533s]
[INFO] Thermostat Host Memory Core Client plugin ......... SUCCESS [1.444s]
[INFO] Thermostat Host Memory Swing Client plugin ........ SUCCESS [1.040s]
[INFO] Thermostat Host Memory Agent plugin ............... SUCCESS [0.585s] 
[INFO] Thermostat VM Overview plugin ..................... SUCCESS [0.003s]
[INFO] Thermostat VM Overview Core Client plugin ......... SUCCESS [0.832s]
[INFO] Thermostat VM Overview Swing Client plugin ........ SUCCESS [0.761s]
[INFO] Thermostat VM CPU plugin .......................... SUCCESS [0.002s]
[INFO] Thermostat VM CPU Common plugin ................... SUCCESS [0.780s]
[INFO] Thermostat VM CPU Core Client plugin .............. SUCCESS [0.697s]
[INFO] Thermostat VM CPU Swing Client plugin ............. SUCCESS [0.883s]
[INFO] Thermostat VM CPU CLI Client plugin ............... SUCCESS [1.140s]
[INFO] Thermostat VM CPU Agent plugin .................... SUCCESS [1.072s]
[INFO] Thermostat VM Memory plugin ....................... SUCCESS [0.002s]
[INFO] Thermostat VM Memory Common plugin ................ SUCCESS [0.537s]
[INFO] Thermostat VM GC plugin ........................... SUCCESS [0.002s]
[INFO] Thermostat VM GC Common plugin .................... SUCCESS [0.728s]
[INFO] Thermostat VM GC Core Client plugin ............... SUCCESS [0.919s]
[INFO] Thermostat VM GC Swing Client plugin .............. SUCCESS [0.964s]
[INFO] Thermostat VM GC Agent plugin ..................... SUCCESS [1.004s]
[INFO] Thermostat VM ClassStat plugin .................... SUCCESS [0.002s]
[INFO] Thermostat VM ClassStat Common plugin ............. SUCCESS [0.612s]
[INFO] Thermostat VM ClassStat Core Client plugin ........ SUCCESS [1.102s]
[INFO] Thermostat VM ClassStat Swing Client plugin ....... SUCCESS [2.620s]
[INFO] Thermostat VM ClassStat Agent plugin .............. SUCCESS [0.793s]
[INFO] Thermostat Command Channel Server ................. SUCCESS [1.415s]
[INFO] Thermostat Remote GC Plugin Common Client API ..... SUCCESS [0.725s]
[INFO] Thermostat GC Plugin Common Client API ............ SUCCESS [0.754s]
[INFO] Thermostat VM Memory Core Client plugin ........... SUCCESS [1.445s]
[INFO] Thermostat GC Plugin Swing Client ................. SUCCESS [0.845s]
[INFO] Thermostat VM Memory Swing Client plugin .......... SUCCESS [0.909s]
[INFO] Thermostat VM Memory CLI Client plugin ............ SUCCESS [0.955s]
[INFO] Thermostat VM Memory Agent plugin ................. SUCCESS [2.531s]
[INFO] Thermostat VM Heap Analysis plugin ................ SUCCESS [0.002s]
[INFO] Thermostat VM Heap Analysis Common plugin ......... SUCCESS [1.872s]
[INFO] Thermostat VM Heap Analysis Agent plugin .......... SUCCESS [1.539s]
[INFO] Thermostat VM Heap Analysis Command plugin ........ SUCCESS [1.512s]
[INFO] Thermostat VM Heap Analysis Core Client plugin .... SUCCESS [1.816s]
[INFO] Thermostat Heap Analysis Swing Client plugin ...... SUCCESS [1.476s]
[INFO] Thermostat Client Living VM Filter VM Lister ...... SUCCESS [0.003s]
[INFO] Thermostat Client Living VM Filter VM Lister Core . SUCCESS [0.930s]
[INFO] Thermostat Client Living VM Filter VM Lister Swing  SUCCESS [0.689s]
[INFO] Thermostat Agent Command Line ..................... SUCCESS [1.314s]
[INFO] Thermostat Kill VM Plugins ........................ SUCCESS [0.002s]
[INFO] Thermostat Agent Kill VM .......................... SUCCESS [0.583s]
[INFO] Thermostat Client Terminate VM plugin ............. SUCCESS [0.852s]
[INFO] Thermostat Storage Library for MongoDB ............ SUCCESS [1.382s]
[INFO] Thermostat Web .................................... SUCCESS [0.002s]
[INFO] Thermostat Web Common ............................. SUCCESS [1.168s]
[INFO] Thermostat Web Client ............................. SUCCESS [1.738s]
[INFO] Thermostat Web Server ............................. SUCCESS [1.239s]
[INFO] Thermostat Web Service Command .................... SUCCESS [0.894s]
[INFO] Thermostat Thread Analysis Plugins ................ SUCCESS [0.003s]
[INFO] Thermostat Thread Info Collector .................. SUCCESS [0.682s]
[INFO] Thermostat Thread Info Client Common .............. SUCCESS [1.395s]
[INFO] Thermostat Thread Info Client Controllers ......... SUCCESS [0.706s]
[INFO] Thermostat Thread Info Swing Client ............... SUCCESS [1.504s]
[INFO] Thermostat Thread Info Harvester .................. SUCCESS [0.722s]
[INFO] Thermostat System Backend ......................... SUCCESS [0.919s]
[INFO] Thermostat GC Plugin Command Channel .............. SUCCESS [0.640s]
[INFO] Thermostat NUMA plugin ............................ SUCCESS [0.002s]
[INFO] Thermostat NUMA Common plugin ..................... SUCCESS [0.603s]
[INFO] Thermostat NUMA Agent plugin ...................... SUCCESS [0.598s]
[INFO] Thermostat NUMA Core Client plugin ................ SUCCESS [0.757s]
[INFO] Thermostat NUMA Swing Client plugin ............... SUCCESS [0.883s]
[INFO] Thermostat Distribution ........................... SUCCESS [14.425s]
[INFO] Thermostat Web WAR package ........................ SUCCESS [1.927s]
[INFO] Thermostat Development Modules .................... SUCCESS [0.003s]
[INFO] Thermostat Development External Maven Archetype ... SUCCESS [1.659s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:57.573s
[INFO] Finished at: Thu Jan 31 10:13:54 CET 2013
[INFO] Final Memory: 212M/669M
[INFO] ------------------------------------------------------------------------
---->8-------

2 Setting up Eclipse

Now that we have thermostat building on Fedora we can proceed with the development setup. In our case we are going to use Eclipse JDT, the m2eclipse and HGE plug-ins (HGE is optional, but very useful).

Let's install Eclipse JDT and m2e first (this will pull in eclipse-platform and other dependencies):

$ sudo yum install eclipse-jdt eclipse-m2e-core

Next we'll open Eclipse and install HGE plug-in. Again this is optional.

$ cd path/to/thermostat
$ eclipse -data ../

Click on "Help" > "Install New Software..." and then the "Add..." button in order to add the repository for HGE. Details are:

Name: HGE
Location: https://bitbucket.org/mercurialeclipse/update-site/raw/default/

Next, on the "Install New Software..." dialog select HGE in the "Work with..." drop-down. Select the relevant plug-in and click through the dialogs.

3 Setting up Thermostat in Eclipse

Thermostat uses the standard Maven directory structure. In order to make Eclipse display projects nicely, we are going to use m2eclipse to import the Thermostat bundles into the current Eclipse workspace.

Open up Eclipse, press CTRL+3 and type "maven". Then select "Import (Existing Maven Projects)". Alternatively use "File" > "Import" > "Maven" > "Existing Maven Projects". You should see something like this:

Image:MavenImport.png

Use the "Browse..." button in order to select the root folder of your thermostat clone. This should be the "thermostat" folder if you followed the steps above. Once this was selected, m2eclipse should show a tree of projects:

Image:MavenPomImport.png

Select all and click "Finish". After this you should have all relevant projects in your workspace.

4 Configuring Thermostat Launchers

First note that launching thermostat is always a two-step process. First, the thermostat agent needs to be launched. Second, a thermostat client can be launched (either the CLI client or the GUI). Let's configure some launchers in order to be able to start various thermostat services from within Eclipse. For this purpose the "IdeLauncher" class of the "thermostat-distribution" project has been provided. Select this class, right-click, "Run As" > "Run Configurations...", select "Java Application" and click the new configuration icon:

Image:NewThermostatLaunchConfig.png

The first launch config is going to be for the agent, so we'll call it "Thermostat Agent", set the required environment variable THERMOSTAT_HOME and add the directory where the native code sits to java.library.path. Moreover, we need to pass relevant arguments to the class service --start --print-osgi-info (for the agent launch):

Image:ThermostatLaunchConfigEnvVar.png Image:ThermostatLaunchArguments.png

For "Thermostat CLI" and "Thermostat GUI" launchers, use the duplicate launch configuration icon and simply change the arguments to shell --print-osgi-info and gui --print-osgi-info respectively. Finally run the agent launcher and after that the desired other launcher (CLI or GUI). You're good to go. Enjoy!

Personal tools