Open Source WEB

Get The Project Looking Glass Running on MacOS X 10.3


Introduction

The Project Looking Glass runs on Java 1.5 or later. It doesn't run on MacOS because Java 1.5 for MacOS has not been released and what has been released for MacOS so far is Java 1.4.2 or earlier.

To get The Project Looking Glass running on MacOS with Java 1.4,

  • Retroweaver: The tool which converts the byte code of Java 1.5 to the Java 1.4 or before.
  • EDU.oswego.cs.dl.util.concurrent: Doug Lea's concurrent library. It includes Semaphore for Java 1.4.

Notes

The Project Looking Glass should be run with Java 1.5 and Java 3D 1.3.2.

MacOS X 10.4 will be realeased soon and support Java 1.5. Then there will be no need to use the patches documented here.


Known problems

The following problems are known to occur when running The Project Looking Glass with Java 3D 1.3.1.

  • Transparency sorting problem (fixed Java3D v1.3.2)

Java 3D 1.3.2 has fixed this problem for The Project Looking Glass.


Requirements


MacOS X 10.3

Java 3D and JAI don't work on MacOS X 10.2 or earlier.


Java 3D 1.3.1 and JAI 1.1.2

http://docs.info.apple.com/article.html?artnum=120289


Apache Ant

http://ant.apache.org/


Source code of The Project Looking Glass from CVS

Need following projects from the cvs.dev.java.net.

lg3d-core
lg3d-demo-apps

@see How to build LG3D CVS sources with Eclipse 3.1M4 (written in Japanese)


Retroweaver

http://retroweaver.sourceforge.net/

The tool which converts the byte cord of Java 1.5 to the Java 1.4 or before.

http://sourceforge.net/project/showfiles.php?group_id=104240

Download retroweaver-all.jar from link above.


EDU.oswego.cs.dl.util.concurrent libraries

The Project Looking Glass uses the Semaphore of Java 1.5.

http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html

The link above shows the libraries including Semaphore, which run with Java 1.4.

http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/current/concurrent.tar.gz

Download concurrent.tar.gz from link above.


Reference

http://www.javadesktop.org/forums/thread.jspa?threadID=7297&start=33 (written in Japanese)

http://opengl.jp/blogger/2005/01/lg3d.html (written in Japanese)


What to do on Linux

CVS source rewriting and byte code coversion with Retroweaver should be performed on Linux.

Use Java 1.5 to build The Project Looking Glass on Linux.


Check out the source from CVS

If you login to your Linux environment with the same login name for java.net account, you don't have to enter the cvs login name.

cvs -d :pserver:cvs.dev.java.net:/cvs login
cvs -d :pserver:cvs.dev.java.net:/cvs co -P lg3d-core
cvs -d :pserver:cvs.dev.java.net:/cvs co -P lg3d-demo-apps

Copy Retroweaver libraries

Extract retroweaver-all.jar in the current directory where you checked out the source from CVS.

jar xvf retroweaver-all.jar

Copy the following libraries, which are necessary to run Retroweaver, to lg3d-core/ext.

cp retroweaver/release/retroweaver.jar lg3d-core/ext/.
cp retroweaver/lib/Regex.jar           lg3d-core/ext/.
cp retroweaver/lib/bcel-5.1.jar        lg3d-core/ext/.
cp retroweaver/lib/jace.jar            lg3d-core/ext/.

Edit lg3d-core/build.xml


Add Target retroweaver

Add the new target retroweaver into lg3d-core/build.xml.

   <target name="retroweaver" depends="init">
        <java classname="com.rc.retroweaver.Weaver">
          <arg value="-source"/>
          <arg value="${classes.dir}"/>
          <classpath>
            <fileset dir="ext">
                <include name="retroweaver.jar"/>
                <include name="Regex.jar"/>
                <include name="bcel-5.1.jar"/>
                <include name="jace.jar"/>
            </fileset>
          </classpath>
        </java> 
    </target>

Check Target retroweaver's operation

ant retroweaver

Perform the command above and check if class files under lg3d-core/build/classes are converted.


Edit Target jar

    <target depends="init,compile" name="jar">

Add retroweaver to the above.

    <target depends="init,compile,retroweaver" name="jar">

Check if Retroweaver converts class files when building target jar.

ant jar

Add concurrent.jar to classpath

    <target depends="init" name="compile" description="Compile SDK (exclude X11 integration">

(snip)

            <!-- To add something to the classpath: -->
            <classpath>
                <pathelement location="${ext.dir}/escher-0.2.2.lg.jar"/>
                <pathelement location="${ext.dir}/odejava.jar"/>
                <pathelement location="${ext.dir}/satin-v2.3.jar"/>
                <pathelement location="${incubator.dir}/build/classes"/>
            </classpath>
(snip)

    </target>

Add concurrent.jar to classpath.

                <pathelement location="${ext.dir}/concurrent.jar"/>

After added:

            <!-- To add something to the classpath: -->
            <classpath>
                <pathelement location="${ext.dir}/concurrent.jar"/>
                <pathelement location="${ext.dir}/escher-0.2.2.lg.jar"/>
                <pathelement location="${ext.dir}/odejava.jar"/>
                <pathelement location="${ext.dir}/satin-v2.3.jar"/>
                <pathelement location="${incubator.dir}/build/classes"/>
            </classpath>

Edit org.jdesktop.lg3d.displayserver.AppConnector.java

Rewrite the codes which check versions of Java 3D.

        if (!j3dPackage.getImplementationVersion().startsWith("1.3.2"))
            logger.severe("Project Looking Glass requires Java 3D 1.3.2, but version "+j3dPackage.getImplementationVersion()+" is installed?nYou will almost certainly see NullPointerExceptions");

Rewrite 1.3.2 to 1.3.1.

        if (!j3dPackage.getImplementationVersion().startsWith("1.3.1"))
            logger.severe("Project Looking Glass requires Java 3D 1.3.1, but version "+j3dPackage.getImplementationVersion()+" is installed?nYou will almost certainly see NullPointerExceptions");

Reference: http://www.javadesktop.org/forums/thread.jspa?threadID=7297&start=33 (written in Japanese)


Build EDU.oswego.cs.dl.util.concurrent libraries

Build the concurrent libraries.

This library works on Java 1.5 only, not on Mac X OS with Java 1.4.

tar xvfz concunnernt.tar.gz
cd concurrent
ant dist

Copy concurrent.jar

Copy the concurrent.jar into lg3d-core/ext/.

cd ..
cp concurrent/lib/concurrent.jar lg3d-core/ext/.

Edit org.jdesktop.lg3d.displayserver.DisplayServerControl.java

import java.util.concurrent.Semaphore;

Rewrite the import statement above to the following.

import EDU.oswego.cs.dl.util.concurrent.Semaphore;
        Semaphore canvas3dInitialized = new Semaphore(0, false);

Rewrite the Semaphore generation segment to the following.

        Semaphore canvas3dInitialized = new Semaphore(0);

Reference: http://www.javadesktop.org/forums/thread.jspa?threadID=7297&start=37 (wirtten in Japanese)


Edit org.jdesktop.lg3d.displayserver.nativewindow.TiledNativeWindowImage.java


Edit import statement

import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;

Comment out import statements above and add an import statement to import EDU.oswego.cs.dl.util.concurrent.Semaphore.

//import java.util.concurrent.Semaphore;
//import java.util.concurrent.TimeUnit;
import EDU.oswego.cs.dl.util.concurrent.Semaphore;

Edit Semaphore generation segment

    private Semaphore filledSemaphore = new Semaphore( 0, false );

Rewrite as following one.

    private Semaphore filledSemaphore = new Semaphore(0);

Edit Semaphore#tryAquire

        while(!filledSemaphore.tryAcquire( 2, TimeUnit.SECONDS ))

Rewrite as following one.

        filledSemaphore.acquire();

Reference: http://www.javadesktop.org/forums/thread.jspa?threadID=7297&start=37 (written in Japanese)


Edit lg3d-core/src/devscripts/lg3d-dev

pkill -f "rmiregistry ${RMI_PORT}"

Use killall insead of pkill.

killall -9 rmiregistry

Build release Target

cd lg3d-core
ant release

It is the expectation where

You can obtain the tarball in the lg3d-core/release directory, including the lg3d-core.jar which activate with Java 1.4.

Copy this tarball to MacOS.

scp release/lg3d-YYMMddhhmm.tar.gz macos-hostname:

What to do on MacOS

Build the EDU.oswego.cs.dl.util.concurrent library under MacOS X 10.3.


Extract lg3d-YYMMddhhmm.tar.gz

tar xvfz lg3d-YYMMddhhmm.tar.gz

You will get a directory named 1g3d in the current directory.


Build EDU.oswego.cs.dl.util.concurrent libraries

Build EDU.oswego.cs.dl.util.concurrent libraries on MacOS X 10.3.

tar xvfz concunnernt.tar.gz
cd concurrent
ant dist

Copy concurrent.jar

Copy concurrent.jar built with Java 1.4.2 on MacOS X to lg3d/ext.

cp concurrent/lib/concurrent.jar lg3d/ext/.

Run lg3d/bin/lg3d-dev

./lg3d/bin/lg3d-dev

Now you've got LG3D desktop on MacOS X 10.3! Congratulations! If you can not see it, please feedback. Thanks.


Acknowledgements

We gratefully thank Hirano Kazunari. He gives us a English translation.

@see http://www.javadesktop.org/forums/thread.jspa?threadID=7297&start=48

Thank you for your contribution, Hirano-san.


Comments

Name:
Comment:
vivanno: (Mon Feb 21 03:40:22 2005 )
Hi and thanks for you document :)
I have a problem. When i do "ant retroweaver" eclipse say me:

Buildfile: /Users/vivien/Sites/workspace/lg3d-core/build.xml
init-props:
init:
     [echo] ${incubator.exists}
unpack-x:
    [chmod] chmod: /Users/vivien/Sites/workspace/lg3d-core/src/devscripts/CdViewer: Operation not permitted
    [chmod] chmod: /Users/vivien/Sites/workspace/lg3d-core/src/devscripts/HelloUniverse: Operation not permitted
    [chmod] chmod: /Users/vivien/Sites/workspace/lg3d-core/src/devscripts/README: Operation not permitted
    [chmod] chmod: /Users/vivien/Sites/workspace/lg3d-core/src/devscripts/check_no_x: Operation not permitted
    [chmod] chmod: /Users/vivien/Sites/workspace/lg3d-core/src/devscripts/displayserver: Operation not permitted
    [chmod] chmod: /Users/vivien/Sites/workspace/lg3d-core/src/devscripts/lg3d-dev: Operation not permitted
    [chmod] chmod: /Users/vivien/Sites/workspace/lg3d-core/src/devscripts/lg3d-session: Operation not permitted
    [chmod] chmod: /Users/vivien/Sites/workspace/lg3d-core/src/devscripts/setup: Operation not permitted
    [chmod] Result: 1
retroweaver:
BUILD SUCCESSFUL
Total time: 4 seconds

The build is a sucess but nothing in lg3d-core/build/classes. It's strange CHMOD is to 777 but files are bloqued ! ? :)

Could you help me please ;)
yasuyuki: (Wed Mar 9 22:54:39 2005 )
you need to use Linux to build lg3d-core.
vivanno: (Sun Mar 20 06:13:28 2005 )
Oops sorry. That's ok, i do that under linux.
casyx: (Mon May 2 13:21:58 2005 )
Everything built correctly under Linux, concurrent built on Mac OS X and placed in ext directory, but nothing happens when I run lg3d-dev ... an rmiegistry process is started, but nothing appears.
Andrew: (Mon Jul 4 12:58:55 2005 )
Any update to this since J2SE 5.0 has been released on OS X?  I can't get it to build de to some Java3D compile errors.  Looks like it can't find Java3d at all...and I can't find any mention of it on Apples pages...Anyone?

このサイトは、 IPA の「平成15年度オープンソフトウエア活用基盤整備事業」 の委託事業として開発されたKahuaで試験的に運用しております。

Copyright (c) 2004-2007 株式会社タイムインターメディア About Us