Chat (Lingr.com)
Informaiton
Daily
Column
- MySQL日本語の旅(5/1)
- アクセス向上秘伝(5/9)
- 一風変ったHaskellλ門(6/13)
- SICP Answer Book (5/31) 問題3.26追加
Zope Solution
Extra
アーカイブ
OSS案内所
Site Info
関連リンク
Get The Project Looking Glass Running on MacOS X 10.3
- Introduction
- Requirements
- MacOS X 10.3
- Java 3D 1.3.1 and JAI 1.1.2
- Apache Ant
- Source code of The Project Looking Glass from CVS
- Retroweaver
- EDU.oswego.cs.dl.util.concurrent libraries
- Reference
- What to do on Linux
- Check out the source from CVS
- Copy Retroweaver libraries
- Edit lg3d-core/build.xml
- Add Target retroweaver
- Check Target retroweaver's operation
- Edit Target jar
- Add concurrent.jar to classpath
- Edit org.jdesktop.lg3d.displayserver.AppConnector.java
- Build EDU.oswego.cs.dl.util.concurrent libraries
- Copy concurrent.jar
- Edit org.jdesktop.lg3d.displayserver.DisplayServerControl.java
- Edit org.jdesktop.lg3d.displayserver.nativewindow.TiledNativeWindowImage.java
- Edit lg3d-core/src/devscripts/lg3d-dev
- Build release Target
- What to do on MacOS
- Extract lg3d-YYMMddhhmm.tar.gz
- Build EDU.oswego.cs.dl.util.concurrent libraries
- Copy concurrent.jar
- Run lg3d/bin/lg3d-dev
- Acknowledgements
- Comments
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
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.
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 ;)