Monday, November 1, 2010

How to import source code from SVN to Netbeans 6.9

This post will establish the required steps to import the JSON ME source code from java.net, and in general from a svn repository into your NetBeans 6.9.

The code we want to import can be found at:


Requirements:
  1. Download and install NetBeans 6.9, if you don't have it yet.
  2. Create an account at Java.net, if you don't have one.
Steps:
  1. Start NetBeans 6.9 and go to the menu Team-->Subversion-->Checkout.

    To access the source code using Subversion, you must have Subversion client installed on your system. The first time you start NetBeans to access Subversion, it offers you the possibility to download and install the client automatically or manually.


    Note: With previous releases of NetBeans, the installation had to be done manually:

  2. Once the Subversion client has been installed, you can specify the SVN repository in where the source code is. For this example:

    https://svn.java.net/svn/meapplicationdevelopers~svn

    The last URL can be found at:

    http://java.net/projects/meapplicationdevelopers/sources

    Next, enter your java.net account info and if you have a proxy, you can configure it here as well.


  3. Next, you can choose the directory you want to import.



    For our example, choose:

    demobox/mobileajax/lib/json


    Also, you have to specify which revision version you want to import, press Browse to find the revision you want. For this case, the last revision was 333.



    Finally, you must select the local folder in which you want to import the selected directory and leave the box "Scan for NetBeans Projects after Checkout" checked. Thus, when the process is finished, NetBeans will automatically import the project (in case that the source code contains a NetBeans project).


  4. After importing the source code, there may be problems with the MicroEdition SDK version installed on your system and the one the source code was using. To solve the problem, you can right click on the imported project, choose properties and assign the MicroEdition SDK installed on your system to the project. To troubleshoot other resources, you should check if you have them installed in your system, if not, maybe you should get them before you can compile the source code using NetBeans.

References:

meapplicationdevelopers: Subversion Instructions. 2007. Oracle [online].
Available from Internet:
http://java.net/projects/meapplicationdevelopers/sources
[accessed on October the 27th 2010].


meapplicationdevelopers: Subversion. 2007. Oracle [online].
Available from Internet: http://java.net/projects/meapplicationdevelopers/sources/svn/show/demobox/mobileajax/lib/json
[accessed on October the 27th 2010].


CollabNet Subversion Downloads for NetBeans 6.5. CollabNet 2010 [online].
Available from Internet:
http://www.open.collab.net/downloads/netbeans/
[accessed on October the 29th 2010].