How to build TuxGuitar with NetBeans

Recently a guitar-playing developer asked me if I can help him to build his favorite guitar tab program TuxGuitar from the sources. So here is a small step-by-step guide using NetBeans.

Steps:

  1. Checkout the sources via the NetBeans SVN Client (Team->Subversion->Checkout…) from
    svn://svn.code.sf.net/p/tuxguitar/code/trunk
    (At http://sourceforge.net/p/tuxguitar/code/HEAD/tree/trunk/ you will find the SCM URL)2014-09-23_21h48_10
    2014-09-23_21h46_58 2014-09-23_21h47_09
  2. Open the maven project at trunk\build-scripts\tuxguitar-windows-x86
  3. Right click on the project, choose “Clean and Build” and wait for the assembly to finish.2014-09-23_17h45_25
  4. After that in trunk\build-scripts\tuxguitar-windows-x86\target\tuxguitar-1.3-SNAPSHOT-windows-x86 there is a executable version of TuxGuitar2014-09-23_21h26_40
  5. Start TuxGuitar *g*
    2014-09-23_21h44_50

The setup was easy because NetBeans provides a SVN Client and a Maven installation out-of-the-box. Tested with NetBeans 8.0.1 (running using JDK8) and Windows 7 64bit.

Troubleshooting:

If you use a x64-Windows and a x64-JDK TuxGuitar won’t run because of native 32bit-SWT libraries. You will see the following exception.

Exception in thread "main" java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM

Solution: In the tuxguitar.bat set the path to the java executable of a 32 bit JDK.

 SET JAVA="C:/Program Files (x86)/Java/jre7/bin/java"
Advertisements

Improved Maven-based NetBeans Platform Application Development using JRebel

Some months ago I already blogged about how to tweak the pom.xml of your Maven-based NetBeans platform application so that you can use JRebel to reload your changes. [1] This process has been simplified in the meantime. Thanks to Peter Hansson for letting me know. Steps:

  • Install the JRebel NetBeans IDE Plugin (from the Plugin Center or from your IDE)
  • Make sure “Compile on Save” is enabled for your project.
  • Make sure the “Enable/Disable JRebel” toolbar button is checked.
  • Generate a rebel.xml file: In the context menu of the project choose “Open JRebel panel” and check the checkbox next to your project in the JRebel Panel.
  • Alter the properties section of the pom.xml like this
        <!-- for JRebel 5.x / JRebel 6 Legacy Client -->
        <properties>
            <!--...-->
            <netbeans.run.params.ide/>
            <netbeans.run.params>-J-javaagent:"${current.jrebel.agent.path}" -J-Drebel.log=true ${netbeans.run.params.ide}</netbeans.run.params>
        </properties>
    
        <!-- for JRebel 6.x (Non-Legacy Client)-->
        <properties>
            <!--...-->
            <netbeans.run.params.ide/>
            <netbeans.run.params>-J-Xbootclasspath/p:C:\temp\rebelboot.jar -J-javaagent:"${current.jrebel.agent.path}" -J-Drebel.log=true ${netbeans.run.params.ide}</netbeans.run.params>
        </properties>
    

    The NEW and COOL thing is that you do not have to bother yourself with the path of the JRebel jar file anymore. The JRebel NetBeans IDE plugin sets the path to the JRebel jar from your IDE into the Maven property “current.jrebel.agent.path” and you can reuse it in your pom.xml. Now there will be no hardcoded paths anymore, when you check-in your pom.xml to SCM – except the JRebel6 bootclasspath edge-case.

  • run the module – the application with your module and JRebel should start up
  • make changes to your classes and JRebel will pick them up

Here a screenshot to illustrate the previous steps: 2014-09-03_23h34_17 Tested with NetBeans 8.0, JRebel NetBeans IDE Plugin 5.6.2 [1] https://benkiew.wordpress.com/2013/10/27/maven-based-netbeans-platform-development-with-jrebel-6-minor-update/