Netbeans+6.0+(weka-src.jar)

toc

Since the Subversion structure changed in early November 2008, the structure of the weka-src.jar changed as well. This affects the nightly snapshots and versions later than 3.4.13 and 3.5.8.

The Example setup used in this HOWTO is for a Linux/Unix based operating system. If you are using Windows, you will have to adapt the paths accordingly (using backslashes instead forward slashes).

= Requirements =
 * ANT
 * Java 1.4 or later for Weka 3.4.x
 * Java 1.5 or later for Weka 3.5.x or later

 = up to 3.4.13 and 3.5.8 =

Extract the source code
Extract the source code from the with any archive manager that can handle the [|ZIP] file format into a temporary directory (don't forget to re-recreate the folder structure when extracting).

Setup Netbeans
> //File -> New Project//
 * Create a new //Java application//

>


 * Enter the project details
 * Project name: //weka//
 * Project location: ///tmp//
 * Create main class:
 * book version: ////
 * developer version: ////

>


 * Click on //Finish//

Move sources
> > //Build -> Build Main Project// > //Run -> Run Main Project//
 * Move the directory from the previously extracted  into the following directory (overwrite existing files and directories):
 * Go back into Netbeans, it should automatically notice that there are new files
 * Build the project
 * Run Weka with

Additional libraries
Just add any additional jars that you may need (e.g., for accessing databases) to the //Libraries// section of the project (on the same level as //Source packages//).

 = newer than 3.4.13 and 3.5.8 =

Extract the source code
> >
 * Create a directory for the source code, e.g., the following:
 * Extract the source code from the with any archive manager that can handle the [|ZIP] file format into the directory you just created (don't forget to re-recreate the folder structure when extracting).
 * create a directory, if necessary (on the same level as )
 * run the (above the  directory) from command-line for creating all the necessary directories:

Setup Netbeans
> //File -> New Project//
 * Create a new //Java project with existing Ant script//

>


 * Fill in the project details
 * Location: ///tmp/weka//

>


 * Remove the //Run Project// and //Test Project// targets

>


 * Add ///tmp/weka/src/main/java// as //Source package folder//

>

> //Build -> Build Main Project// >> //Run -> Run file -> GUIChooser.java// >> //Run -> Run file -> Main.java//
 * Click on //Finish//
 * Build project
 * Open GUI class that you want to execute:
 * book version: ////
 * developer version: ////
 * Execute class
 * book version
 * developer version
 * Click on //Generate// when asked that a build target needs to be generated (this step and the next one are only necessary once, since Weka's doesn't have a default target for executing classes)

>


 * Use as //basedir// instead of  in the  file

>


 * Save and close the files and
 * You can now choose //Run -> Run file -> // to execute any class

Additional libraries
You have to modify the in order to add additional libraries. In order to do that, just extend the tag there. For instance, if you want to add the to your project in order to access a MySQL database then the tag has to look like this: code format="ant"  code For more information, checkout the [|ANT documentation] of the //core// task //Java//.