Get Started using Java - XPLProject

Contents

Overview

xPL4Java is cross-platform environment to run Java based xPL applications. That is, it is an "engine" that any xPL4Java based applications you have use. The Java platform allows an xPL application to run on any supported platform without changes. At last count, xPL4Java can run on at least 6 different operating systems -- Windows, Mac OSX, Linux, Solaris, etc

xPL4Java permits the xPL applications author to create a single xPL application and have it be able to run on any computer system. As a result, you can pick the operating system that suits you vs. having to run a certain operating system to suit a certain application you need.

xPL4Java comes complete with the xPL4Java "engine", the xPL4Java server that will run your xPL applications, a scripting engine for creating your own scripts (or using other downloadable scripts) and some example xPL applications (like xPL_Clock -- a simple xPL app that will send time updates to the xPL network once minute). It also includes an xPLHAL module for running xPL determinators, timed events, scripts, etc (basically, everything you can do with the Windows-only xPLHAL server).

NOTE xPL4Java is a cross-platform program. As such, the instructions that follow are failry generic and often followed with specific examples for some of the more common platforms. It's important you do not read the instructions assuming they are only written for your platform (Windows, OSX, Linux, etc) but keep yourself open to the concepts and look at the examples.

Getting xPL4Java Running

Requirements

You must have Java version 1.5 (also known as Java 5) or later installed on your computer. You can download Java for your computer from the Javasoft site. You only need to download the Java Runtime Environment (JRE). The other Java downloads are for developers and unless you plan on developing Java programs, they have lots and lots of unneeded stuff and triple the size of the download. For folks running Mac OSX, you can download the J2SE kit from Apple

You must also have a working xPL hub running on your computer. There are a number of hubs available and generally there is one available for most platforms. You can find more hubs on the Downloadable Packages page.

Installation

You can download xPL4Java from the xPL4Java site. You can download a .zip file or a compressed tar file -- whichever is best for your computer. Extract the contents of the file into a directory appropriate for your computer. Some suggestions might be

For Windows: Extract it into "C:\Program Files\xPL"
For Linux/Solaris/BSD: Extract it into /usr/local/xPL
For Mac OSX: <if you know, fill it in here>

Startup

Depending on what O/S you are running, startup may be as easy as double clicking on xPL4Java.jar (in the case of Windows and Mac) or issuing a short command under Linux/Solaris/BSD (or under Windows or Mac OSX, for that matter) like this:

For Linux/Solaris/BSD: java -jar /usr/local/xPL/xPL4Java/xPL4Java.jar &
For Windows: javaw -jar "C:\Program Files\xPL\xPL4Java\xPL4Java.jar"
For Mac OSX: java -jar <path to installed xPL apps>/xPL/xPL4Java/xPL4Java.jar &

You'll want to insure xPL4Java starts everytime you reboot your computer. For Windows, you could just create a shortcut to the xPL4Java.jar in the Programs->Startup folder. For Linux systems, add the command line to the end of /etc/rc.local (a good place to start any hubs too). For Mac OSX, <if you know, fill it in here>

Once xPL4Java is running, it should see your network and your xPL network should see it. If you run a configuration tool like xPLHAL or DCM, you'll see the xPL4Java server waiting for configuration.

Installing a new xPL4Java application

Installing a new xPL4Java application is generally pretty easy to do. The applciations author will provide a downloadable file. That may include additional instructions you should read before continuing. Included in the download will be one or more files with an extension of "jar". Just copy those files into the xPL4Java jars subdirectory and xPL4Java will start them and automatically run them for you. The jars subdirectory is in the same directory you installed the xPL4Java app. So, for example:

For Windows: C:\Program Files\xPL\xPL4Java\jars
For Linux/Solaris/BSD: /usr/local/xPL/xPL4Java/jars
For Mac OSX: <>path to installed xPL apps>/xPL/xPL4Java/jars

If the application can be configured, it should quickly show up in whatever manager you use (like xPLHAL for Windows or DCM for other platforms).

It really is that simple. Again, do be sure to read any instructions that come with the application in case there are additional steps.

Additional topics to be written

Scripting
Configuring xPL4Java
Developing new modules with the xPL4Java API

This page was last modified on 29 July 2008, at 11:13. This page has been accessed 10,024 times.