DMelt:General/6 Netbean

From HandWiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Member



DataMelt single-jar library

DataMelt can be used in form of "single-jar" library for deployments inside fully-featured NetBeans IDE (see Netbean) or Eclipse IDE. This takes advantage of many features of these professional tools. In addition, you can write scripts in Jython, Groovy and JRuby (after installing appropriate plugins),

For members, DataMelt can be download as:

  • Single-jar library under the GNU GPL license (cannot be used with closed code)
  • Single-jar library under the LGNU license (for commercial applications). Read DataMelt license

The first library is available for DataMelt members, the second is for developers.

Here an example of how to use single-jar library:

Assume you have dmelt_onejar.jar and you have untarred jython (the linux/mac command: tar -vzfx jython.tgz) Your directory will look as:


dmelt_onejar.jar # DataMelt single-jar library jython/ # directory with Jython


Now you can run any DataMelt Jython code from examples. Here is a simple example that shows how to run an example points0.py:

java -cp jython/jython.jar:dmelt_onejar.jar -Dpython.home=jython org.python.util.jython points0.py

Of course, you can use "dmelt_onejar.jar" to run any Java code.

Single-jar library for NetBeans/Eclipse

Here are the steps which are needed to port the DataMelt library into NetBeans. You can do similar steps for Eclipse IDE. Below we provide a single jar file which include all DataMelt libraries (excluding those which belong to the DataMelt IDE) and pre-configured Netbeans platform to work with such libraries.

How to setup NetBeans IDE

Follow these steps:

  1. Download Netbeans version 6.9.1 Look at the link [1] and select Java SE
  2. Install "Python plugin"
  3. Download recent [[2]] file
  4. Import this file.

A Python project

For Python/Jython project, do this: "Tools"->"Python platforms"->""Java path" and click "Add". Select the dmelt_onejar.jar and close it.

You can create a new Python project as : "File"->"New project"->"Python"->"Python project" and click "Next". Then, in your python code, type some example to check the installation:

from jhplot import *
c=HPlot("OK")
c.visible()

and click run. The console will show it it processes this jar file (only one time) and then you will see a pop-up window of the canvas.

Java projects

This is also easy. Create a new Java project ("File->New project"->Java application"). Click next. On the left window ("Projects"), click on the name of your project with right mouse. and select "Properties". You will see a new window. Select "Library". Then click "Add library". Select the "dmelt_onejar.jar". Now you can write you project, like:

import jhplot.*;
HPlot c= new HPlot("OK");
c.visible()

You will see the same result as in the Python case.