Home | Changes | Index | Search | Go
Building and Running Project Looking Glass with Eclipse 3.1
This document illustrates how easy it is to get a development
environment up and running for the java.net Project Looking Glass
with Eclipse IDE. As you will read in this document, using Eclipse
IDE as the development tool for building and running Project Looking
Glass makes Project Looking Glass development very simple.
Getting Started
To get started you will first need to set up your environment.
Once you have verified that your environment is set up correctly you
will be ready to build and run Looking Glass from Eclipse.
Platform Requirements
Before you start setting up your Project Looking Glass development
environment, first check to make sure your system meets the following
minimal requirements.
|
Component
|
Linux Platform
|
|
Operating System
|
Most modern linux distributions should work, although there has
been problems experienced when running it on a portage-based
java-install. We suggest following this guide for installing all
components listed manually instead of using portage.
|
|
CPU
|
2 GHz or faster recommended
|
|
RAM
|
512MB recommended
|
|
Graphics Card
|
3D accelerated graphics card, with at least 16MB VRAM and
driver support for OpenGL?, version 1.2 or greater. 16bit or
-
-
- bit color.
IMPORTANT! 24-bit display depth is required! See instructions below for how to configure this. | | Disk Space | 350MB |
Tested Video Cards
Setting up your environment
Before you can build and run Project Looking Glass, you need to
install a number of Java components. The simplest way to do this is
to download all of the components and then install them in the order
listed below.
Download the components
Note: The installation instructions assume that you
download all of the components into /tmp.
Java 2 SDK, Standard Edition 1.5.0 or
later. http://java.sun.com/j2se/1.5.0/download.jsp
Note:
The installation instructions below assume you download the RPM
version of the JDK.
Eclipse 3.1 IDE http://eclipse.org/downloads/index.php
Java 3D SDK 1.4 build 1 or
later https://java3d.dev.java.net/binary-builds.html
Note:
Navigate to the Stable builds 1.4.0 and download
java3d-1_4_0-build1-linux-i586.zip or later.
Java Advanced Imaging API (JAI) 1.1.2 JDK
http://java.sun.com/products/java-media/jai/downloads/download-1_1_2.html
Note:
Select the JDK(TM) Install: Bundle for installation in a JDK
Download. After reading and agreeing to the Software License
Agreement, choose the Linux JDK Install item
(jai-1_1_2-lib-linux-i586-jdk.bin).
Install the Components
After downloading all of the components, install them by following
the instructions below.
First become root:
%
su root Password: enter root password #
Install the Java 2 SDK:
#
cd /tmp # /bin/bash jdk-1_5_0_02-linux-i586-rpm.bin # rm
jdk-1_5_0_02-linux-i586.rpm # rm jdk-1_5_0_02-linux-i586-rpm.bin
Install the Java 3D SDK:
#
cd /tmp # unzip java3d-1_4_0-build1-linux-i586.zip # cd
/usr/java/jdk1.5.0/jre # unzip
/tmp/java3d-1_4_0-build1-linux-i586/j3d-140-build1-linux-x86.zip #
cd /tmp # rm -r java3d-1_4_0-build1-linux-i586/
Install the Java Advanced Imaging API:
#
cd /usr/java/jdk1.5.0 # /bin/bash
/tmp/jai-1_1_2-lib-linux-i586-jdk.bin
Exit from the root shell:
#
exit %
Several environment variables now need to be set in your
shell profile. Here are examples appropriate for
bash(1):
JAVA_HOME=/usr/java/jdk1.5.0 PATH=$JAVA_HOME/bin:$PATH
Install the Eclipse IDE:
%
untar -uhv your_eclispe_filer.tar.gz
Register at the java.net web site
If you haven't previously registered at java.net
then you'll need to create an account:
Navigate to http://www.java.net
and click on the Register link at the top of the page.
Enter your preferred user name and
e-mail address and then press the [Register] button.
You'll receive an e-mail message with instructions on how to
set a password for your account. Once you've entered your password
and accepted the java.net website terms of participation you'll be
logged in.
Configure the
color depth of your display
The Project Looking Glass Developer's Release requires a color
depth of at least 24 bits. Many systems are configured by default
with 16 bit color depths and the Project Looking Glass Developer's
Release will not run correctly at this depth. You can identify the
current display depth by running the following command:
% xdpyinfo |
grep "depth of root" depth of root window:
24 planes
If you see a value lower than 24, you must change the color depth.
The process for changing the color depth varies by platform. Refer to
the configuration instructions for your platform below:
Java Desktop System 1 and 2, and SUSE8.1:
From within a desktop session, run the sax2 command:
%
- /usr/X11R6/bin/sax2
SaX - root Password:
enter root password In the SaX2? application, click on Color and Resolution then click the [Properties...] button for the currently configured desktop. In the Color selection... panel, click on the the menu and choose 16.7 Mio. [24 Bit]. On the Resolution(s) for 16.7 Mio. [24 Bit] colors tab, select the preferred resolution for your desktop and press [Ok]. Click the [Finish] button, then [Finalize>>]. The SaX2 final steps... dialog will open. Click the [Test...] button to test the new resolution. A blue test screen should appear, click the [Save] button if the display appears to be stable, and then [Ok] when you return to the SaX2? window, followed by [Yes] to exit from SaX2?. If the test screen did not appear correctly, the test will exit after 30 seconds and your previous desktop session will be restored. You should then try alternate resolutions at the 24 bit color depth to find a resolution that works for your system. When you are satisfied with the settings, log out and re-login to your desktop session and verify that the color depth is now 24 bit or higher using the xdpyinfo command above.
RedHat? Fedora 2:
First become root:
%
su root Password: enter root password #
Edit the file: /etc/X11/xorg.conf
Locate the section of the file
- labeled
- Section "Screen"
Within this section, locate the entry: Identifier "Screen0" Change the DefaultDepth and DefaultFbBpp properties to:
DefaultDepth
-
DefaultFbBpp 32 Save the file and then logout and re-login to your desktop session and verify that the color depth is now 24 bit or higher using the xdpyinfo command above.
RedHat? 8, RedHat? 9 and other Linux platforms:
Many Linux platforms use the XF86Config
file to configure the display properties. To change the color depth
on these systems:
First become root:
%
su root Password: enter root password #
Edit the file: /etc/X11/XF86Config
Locate the section of the file labeled: Section
"Screen" and change the DefaultDepth
property to 24:
DefaultDepth
-
Within this section, locate the sub-section labeled "Display":
SubSection "Display"
and change the Depth property to:
Depth
-
Save the file and then logout and re-login to your desktop session and verify that the color depth is now 24 bit or higher using the xdpyinfo command above.
Using Eclipse to Build and Run Looking Glass
Now that you have the necessary environment to build Looking
Glass, you are ready to launch Eclipse, get the Looking Glass source
code, build Looking Glass from source and run Looking Glass all from
within Eclipse
Launching Eclipse
To launch Eclispe, simply type eclipse at the command prompt in a
terminal window:
%
eclipse
The above command will launch the Eclipse IDE.
Getting the Looking Glass Source Code
The next step is to configure the Eclipse IDE to retrieve the
Looking Glass source code from the java.net CVS repository. There are
three Looking Glass CVS repositories which you must retrieve source
file from, lg3d-core and lg3d-demo-apps and lg3d-incubator. The steps
to setup and retrieve source files in Eclipse is described in the
next three sub-sections, Getting the lg3d-core source and Getting the
lg3d-demo-apps source and getting lg3d-incubator source.
Getting the lg3d-core source
In the Eclipse IDE, from the main menu select File > New >
Other . And You see below window

Figure 1 File > New >
Other
and choose Chekout project from CVS like in Figure 1 and click
next, and You should see dialog like in Figure 2
 Figure
2.
Now fill this window like in Figure 2 (is You want You can select
Save Password) and go next.
 Figure
3. Selecting project to CheckOut
Select "Use an existing
module", wait a moment, find lg3d-core on list of java.net projects or You
can select use "specified module
" name and write g3d-core in text label. And click Next
 Figure
4
In figure 4 only click
Next
 Figure
5. selecting branch of lg3d-core
In Figure 5 click button
Refresh Tags
,select last version of lg3d-core, and click Finish
button.
 Figure
6.
Choose like in Figure 6 Java
Project and click Next
button.
 Figure 7.
In label named Project Name
type lg3-core
like in figure 7 image, and click Next button.
 Figure
8 Default Output folder
Like in figure 8 in label
Default output folder type lg3d-core/build
, and click finish. And
wait some time for download lg3d-core to Eclipse Workspace.
After CheckOut
lg3d-core, You must CheckOut in the same way lg3d-incubator
and lg3d-demo-apps
Seting up Eclipse Workspace
After getting all project sources You should set proper source
folder and etc...
 Figure 10 Setting
sources path
In Java or Resurce view Click right button of
mice on lg3d-core and select Project
Properties and like on figure 10. Choose Project Build
Path select tab Source remove defaults eclipse settings,
click Add Folder button and like on image select
sources. And change tab to Libaries.
You must
do the same with lg3d-demo-apps and lg3d incubator
 Figure 11
Adding lg3d-core llibaries
In tab libaries add jars files from
ext folder by clicking Add JARs...
 Figure 12
in project
properties window You should add project
references
to lg3d-core.
You should do this withlg3d-incubator and
lg3d-demo-apps
Figure
13. Now You need add lg3d-core classes
to lg3d- incubator and
lg3d-demo-apps as libaries. Like in figure
13 in in project
properties (lg3d-incubator and
lg3d-demo-apps) tab Libaries
add classes of lg3d-core
Figure 14.
Click Show View > Ant and add by clicking "+"
build.xml of lg3d-core. You should see all targets in ant view window
like in figure 14. Now run "all" targets. After first compile
process You can ran Project Looking Glass without
lg3d-demo-apps and lg3d-incubator apps
by running "run-dev" target or with all application by running
"run-dev-script"
 Figure 15.
Now You can add also build.xml
to ant view lg3d-incubator. To build only
lg3d-incubator apps. For end You should
set property java code formating for java sources file. Go
to
Main Menu > Window >
Preferences.
 Figure 16 Setting Java
Code Conventions
You should see Window
like in figure 16. In left tree select Java > Code
Style > Formatter and change Select profile to
Java Conventions[bult-in]. More about Java Code
Conventions You can find here.
enjoy.
|