DMelt:General/1 Installation

From HandWiki
Revision as of 14:32, 10 April 2023 by MainEditor (talk | contribs) (→‎Installation for Windows)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Member

Installation

DataMelt (DMelt) program is a self-contained software that can be ran using Java Virtual Machine (JVM). The current version of DMelt (version 3.X) can be executed using the JDK18 and above.

First, make sure that the JAVA virtual machine is installed. Simply click on Java check link to verify JAVA version. For Linux/Mac, you can also check the JAVA by typing in the terminal:

java -version

You will see:

openjdk version "18.0.2-ea" 2022-07-19
OpenJDK Runtime Environment (build 18.0.2-ea+9-Ubuntu-222.04)
OpenJDK 64-Bit Server VM (build 18.0.2-ea+9-Ubuntu-222.04, mixed mode, sharing)

or a similar message. You can install Java using this link Java install page. You can also install JAVA JDK (for developers) from the Oracle JAVA download page. The JDK JAVA version allows you to compile JAVA code using the "javac" compiler. Linux/Mac users usually have JAVA installed by default.

Also note:


DataMelt Installation

All current and previous versions of DataMelt can be downloaded from DataMelt download page.

Installation for Linux/Mac OS

Download the installer dmelt-[VERSION]-installer.jar, where [VERSION] is a version number. Then double click on the file name. Alternatively, run the command:

java -jar dmelt-[VERSION]-installer.jar

You can also use the portable dmelt-[VERSION].zip file and unzip it in any directory. Here is an example:

wget -O dmelt.zip http://sourceforge.net/projects/dmelt/files/latest/download
unzip dmelt.zip
./dmelt.sh     # run DMelt IDE using Limux/Mac console.

This means you should set your console to the "bash" mode (otherwise, type "bash" before launching this script).

One can also use a development (unstable) version from DataMelt.Org:

wget -O dmelt.zip https://datamelt.org/download/current.php
unzip dmelt.zip
./dmelt.sh     # run DataMelt IDE

You can also run scripts without the GUI. Look at the section Running DMelt.

First time start-up takes a bit longer then usual since Jython caches the Java jar libraries (it creates the directory "jython/cachedir" with the description of all classes located in jar files defined in the CLASSPATH variable.).

Installation for Windows

You can run DataMelt on Windows 11/10/8/7. Download the installer dmelt-[VERSION]-installer.jar from DataMelt download page and double click on the file. Then answer the questions.

The default installation path is "C:\Program Files\DataMelt". If you will see a message "Permission denied", then simply install it to "C:\DataMelt" (or any other location where you have the permission). The installation does not require administrative privileges.

One can also use the portable dmelt-[VERSION].zip file from DataMelt download page. Unzip this file and go to the subdirectory "dmelt", and click the file dmelt.bat. This file will launch the DataMelt IDE.

Note: If you run "dmelt.bat", you need to set the variable JAVA_HOME and PATH to your Java installation. Look at the tutorial How to set JAVA_HOME on Windows 10.

Generic installation using jPort menu

Instead of unzipping the DMelt files, consider using the jPort portable Java menu. This method works for all platforms (Windows, Linux and Mac), and you can carry DMelt on a USB flash drive. In addition, you can install other jWork.ORG applications.

Additional information

DataMelt always puts its installation files inside the "dmelt" directory. It never modifies your Windows system files nor changes the Windows settings. This means that removal of DMelt is very simple - just delete the directory "dmelt"!

For Mac, Linux and UNIX, you can put the file "dmelt.sh" to the

$HOME/bin 

directory, so you can start DMelt from any directory. In this case, you should set the variable "JEHEP_HOME" (defined inside the script "dmelt.sh") to the directory path where the file "jehep.jar" is located.

The full members have access to the professional edition of DMelt-Pro. This version periodically receives bug-fix updates dmelt-[VERSION]pro.zip (note "pro" string).

3rd party restricted libraries

You can download some external 3rd party libraries after you started DataMelt GUI. In the BeanShell interactive prompt, execute the command:

get_external()

This will download some libraries which are usually have some license limitations for commercial use. For example, this will install Michael Thomas Flanagan's Java Scientific Library from the the official web page.

Quick check of examples

You can run all DMelt examples using the menu [Help]-[Examples]. This brings up a window with free examples. Select any file and click [Run] (from this dialogue, not from the IDE toolbar). Look at the YouTube DMelt clip which shows DMelt Online examples.

You can also use free examples using [Online examples]. You can run and view only free examples (marked with the red letter F). If you activated DMelt-Pro, you can view and run all of the examples.

Activation of DMelt-Pro

If you have a full membership, you can activate DMelt-Pro like this: download and run the free DMelt version. Then, go to the DMelt toolbar and select [Help]→[Activate DMelt-Pro]. You need to enter your username and password, exactly as for DMelt membership web page.

DMelt-Pro can be used for a commercial purpose, plus it has full access to built-in examples [Help]→[Online examples], full Java API, online examples,source code etc.

In a few situations, the activation may fail (when, for example, you do not have correct network settings). Then, you will have to request the password by sending a email to dmelt [at] jwork.org

Updating DMelt

Simply remove the directory "dmelt" (if you did not create your files inside the directory "dmelt"!). Then unzip the zip file with a new version. DMelt periodically checks that you are running the most updated version.

If you are using DMelt-Pro (professional) version, you should receive updates of separate jar libraries on a regular basis and thus there is no need to reinstall the entire program. This helps keep all of the numerical libraries on your computer up-to-date.

Uninstalling DMelt

To uninstall DMelt is simple: just remove the directory "dmelt" with your installation (for windows/linux/mac). DataMelt never leaves any files in your system directory or changes Windows register.

Libraries for Eclipse and NetBeans

You can download single-jar file which does not contain IDE. This jar files can be used for import to Eclipse or NetBeans IDE (both good to work with Python or Java). These jar files are available for DataMelt full members as described here [DMelt:General/6_Netbean]. You can also download a minimalistic jar file (~10MB) which can be deployed for applets.

CBook package

If you are working with a C++ program and you will need to visualize data using Java or Jython, then you will need the CBook C++ package This package allows you to fill histograms and vectors in a C++ code, and write them in a "pbu" file which contains zipped data records based on the Google's Protocol Buffers format. One can read such files using the jhplot.io.PFile class of DataMelt. In addition, one can write structural data using a C++ code and read them back using DataMelt (class EFile).

Installation for multiple users

The description discussed above concerns a single-use installation. It may be convenient to install DMelt in a central location (for example on a shared directory on NFS) so all users will be able to run run the program. Below is a step-by step instruction describing how to do this.

  • Unzip the package in some location
  • For the Linux platform, create a bash shell file, say with the name "jh",
  • which will look as:
#!/bin/bash
# set here home directory where the jehep.jar file is located 
JEHEP_HOME=$HOME/work/workspace/dmelt/jehep
################## do not edit ###############################
JAVA_HEAP_SIZE=128
CLASSPATH=$JEHEP_HOME"/jehep.jar":$CLASSPATH
# set jython home
export JYTHON_HOME=$JEHEP_HOME"/lib/jython"
# Add in your .jar files first
for i in $JEHEP_HOME/lib/*.jar
do
      CLASSPATH=$CLASSPATH:"$i"
done
# Add in your .jar files first
for i in $JEHEP_HOME/lib/*/*.jar
do
      CLASSPATH=$CLASSPATH:"$i"
done
# convert the unix path to windows
if [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then
   CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
fi
EXT_DIR=$JEHEP_HOME/lib/freehep:$JEHEP_HOME/lib/system:$JEHEP_HOME/lib/user:$JEHEP_HOME/lib/update
if [ -z $JAVA_HOME ]; then
        java -mx${JAVA_HEAP_SIZE}m -cp $CLASSPATH -Dpython.home=${JYTHON_HOME}
-Djava.ext.dirs=${EXT_DIR} -Djehep.home=$JEHEP_HOME jehep.ui.mainGUI  $1 &
else
        $JAVA_HOME/bin/java -mx${JAVA_HEAP_SIZE}m -cp $CLASSPATH
-Dpython.home=${JYTHON_HOME} -Djava.ext.dirs=${EXT_DIR}
-Djehep.home=$JEHEP_HOME jehep.ui.mainGUI $1 &
fi

Change in this file the variable "JEHEP_HOME" which points to the directory with located file "jehep.jar".

  • Unordered List ItemCopy this file into some where the variable PATH can
  • find it. Assume you put this file to "share/bin/jh". In this case point to
  • this executable in the files ".bashrc" and (or) ".bash_profile" which
  • are usually located in users home directory. Put these lines into these
  • files:
export JHINSTALL=/share/bin/jh
export PATH=$JHNSTALL/bin:$PATH

You are done. Now any user can run the program by executing "jh" command.