How to use NetBeans with Greta

This page is dedicated to developers to install, compile and make development on Greta Project. NetBeans use many templates to help developers to code easily. But its default managment is to simplistic for the development of Greta. That’s why we must take care on some stuff when we create a new NetBeans project in Greta.

How to install Greta and compile it with NetBeans

Installation

Configuration files modification

  • Open “GRETA_DIR”/bin/Player/Lib/External/Win64/Plugins_DX9.cfg and <GRETA_DIR>/bin/Player/Lib/External/Win64/Plugins_OpenGL.cfg

  • Change “PluginFolder” value to absolute path

NetBeans configuration

  • Open NetBeans and right click on project space (left of NetBeans window)

  • Select Project Group/New Group and choose the name that you want to give to your project

  • Select Folder of Projects and browse in the directory (previously get from SVN) /trunk/VIB

http://greta.isir.upmc.fr/images/2/29/GretaNetbeans.JPG
  • Compile the project All_Javadoc by clicking right on it

  • Do the same for compiling Modular

Set your correct @author tag

Make this step only once.

  • In the NetBeans menu, choose “Tools” -> “Templates” to open the template manager

  • Click on “Settings” button. It opens the User.properties file.

  • Add the line with you name using the correct case user=Firstname Lastname

Template to include the license in the code

Make this step only once.

  • In the NetBeans menu, choose “Tools” -> “Templates” to open the template manager

  • select the “Licenses” folder and clic on “Add…” button

  • choose the file “GRETA_DIR”/license-greta.txt

  • select the “Licenses” folder and clic on “Add…” button

  • choose the file “GRETA_DIR”/license-greta-auxiliary.txt

If you don’t do it, you will have some (benign) error when creating a new class.

Create a library

  • create a new project with NetBeans, and choose “Java Class Library” then choose a good name and path

  • edit the file “myProject”/build.xml

  • insert (and check relative path !) :

import file="../../nbbuild.xml"

it must be added before the line

import file="nbproject/build-impl.xml"
  • edit the file <myProject>/nbproject/project.properties and add lines :

compile.on.save=true
project.license=greta
  • change the values (and check relative path!):

application.vendor=Catherine Pelachaud
dist.dir=../../bin/Common/Lib/Internal
javac.source=1.8
javac.target=1.8

first: because it’s Catherine’s. second : set the final destination of the jar . If your version of NetBeans is lower than 7.x, you must add the line : mkdist.disabled=true

  • save the two files

  • shut down NetBeans and restart it

Create an executable

It’s almost the same:

  • create a new project with NetBeans, and choose “Java Application” then choose a good name and path

  • edit the file “myProject”/build.xml

  • insert (and check relative path !)

import file="../../nbbuild.xml"

it must be added before the line:

import file="nbproject/build-impl.xml"
  • edit the file <myProject>/nbproject/project.properties and add lines :

compile.on.save=true
work.dir=../../bin
project.license=greta

change the values (and check relative path !):

application.vendor=Catherine Pelachaud
dist.dir=../../bin
javac.source=1.8
javac.target=1.8

first: because it’s Catherine’s. second : set the final destination of the jar * save the two files * shut down NetBeans and restart it