How to install vearth on windows
From Docs
Contents |
You will need:
- The latest version of the Java2 Standard Edition (J2SE) Java Runtime Environment (JRE) - at least version 1.4; or if you will be doing development you may prefer the larger J2SE Software Development Kit (SDK).
- mysql - note this is a link to version 3.23.53. We had some difficulties getting version 4 to work, a least under Windows XP. If you can get version 4 to work, please let us know how.
- http://prdownloads.sourceforge.net/jboss/jboss-4.0.0.zip?download jboss].
- A stable version of the vearth server (check out the file named 3map from cvs on sourceforge) - or just download the latest vEarth snapshot.
- A world model cache if you want to view the database results in a VR model. You can generate one of your own using rez, or contact us for our latest earth model.
- If you want to build vearth from source, you will need apache ant.
Install these wherever you like. I just followed the installers' lead and put them all in C:\
Configuration
Setting the Environment variables.
From the START menu, select Settings>Control Panel>System. In the System Properties dialog box, choose the Advanced tab, then click Environment Variables.
You will have to create three new Environment Variables. To do this, click NEW. Note that there are two NEW buttons - you want to set these as System Variables, not User Variables. Set the Variable Name and the Variable value as follows:
- Set JAVA_HOME to your Java runtime directory. For example, C:\j2sdk1.4.2_05
(click NEW again)
- Set WEBROOT to the directory where you have installed your world model. For example, C:\planet-earth
(click NEW again)
- Set JBOSS_DIST to the jboss install directory - e.g. C:\jboss-4.0.0
(click NEW again)
IF you've installed Apache Ant, set ANT_HOME to the Apache Ant install directory - e.g. C:\apache-ant-1.6.2 Now find the existing Path variable, which will have a lot of stuff in it already.
To the end of the value in there, append the paths to your Java bin, your mysql bin and your Apache ant bin, using semicolons as separators - something like:
;C:\apache-ant-1.6.2\bin;C:\j2sdk1.4.2_05\bin;C:\mysql\bin;
Configuring jboss
To configure jboss, edit run.bat in your jboss bin directory.
Find the following line (about halfway down)
set JAVA_OPTS=%JAVA_OPTS% -Dprogram.name=%PROGNAME%
and append
-DWEBROOT=%WEBROOT%
(there should be a space between the original and your addition)
Setting up the database in mysql
- Create a text file called run.bat in your mysql bin directory. The file should have the following text:
mysqld --basedir C:\mysql
(that's if you put mysql in C:\mysql. If you put it somewhere else, type that path instead).
- Save the file; then doubleclick it. This will launch mysql with the basedir set up as you need it.
- If you're running Service Pack 2, you will need to click UNBLOCK now.
Creating the vearth database
with mysql running (as shown above), open a shell window. (start>run>cmd)
Type the following:
mysql create database vearth;
Then exit mysql by typing
exit
Change to the C:\3maphost\scripts\sql directory and type:
mysql vearth; \. vearth.sql
you can check the tables are built by typing
show tables;
Then to exit mysql, you type
exit
You now have mysqld running. Well done :)
Running jboss
go to your jboss\bin directory and type
run
Deploying vearth in jboss
Either
- copy the vearth.ear file from C:\3maphost\dist\vearth.ear to jboss\server\default\deploy\vearth.ear
Or
- If you prefer to compile it yourself, change to the directory where you have the vearth source, and type
ant
You're done!
Try it in your web browser: http://localhost:8080/vearth and login.
Look in the app_user table (username and password) to see some of the logins available. Most test data is linked up to userid 'justin'. All default passwords are 'aaa'.
Now that you have this set up, next time you can just run mysql, then jboss then enter the url in your browser.
Additional Information
Most of the following is covered already but there is some additional information on the mysql setup and jboss setup in the following. If it's all working, you can ignore the following notes.
Building the application
You will need to do a number of things to get the application (vearth) to work. This involves getting the build to work, and getting the app to deploy and run under JBoss.
Building the app requires the following environment variables to be set:
JBOSS_DIST - your JBoss home directory ANT_HOME - ant home directory JAVA_HOME
If these are set correctly, the build should be OK.
To build the app, run 'ant gen-rebuild' from the application root directory. This will generate all the required classes and compile, build and deploy.
[if this fails with “unable to delete directory <base directory>\build-output then make sure no applications are accessing files in that directory, create the build-output directory if it doesn’t exist, then rerun ant]
You only need to do 'ant gen-rebuild' once. After that you can just do 'ant' and all your changes will be compiled as required, built and deployed.
Creating the database schema
First, create a mySQL database called 'vearth' using the mySQL admin console. The JBoss deploy config is set up to *not* create the tables when app is deployed.
You have to create the tables and data yourself using the scripts in app/scripts/db. The easiest way to do this is run a mysql session (C:\mysql\bin\mysql.exe).
Connect to the app database: > connect app Run the db create and data load script: > \. app/scripts/db/app.sql This will create the schema and load the test data.
Running the application
The 'ant gen-rebuild' command will build and deploy app, so as soon as you run up Jboss the application will be available. You should be able to get to app (http://localhost:8080/vearth) and login.

