Skip to main content

Java 3D running with Java 7 on Windows

2 replies [Last post]
sunflower1
Offline
Joined: 2008-09-18
Points: 0

Hi,

I have implemented a Java 3D scene graph which can be opened in one application run more than once with new data therefore I create new instances. I am using seperate Canvas3D intances. Recently, I switched to JDK 7 instead of 1.6 and since then I get random errors which force the whole application to crash. I found a forum enty which also indicates that Java 7 causes problems with J3D (http://groups.google.com/group/fiji-users/browse_thread/thread/643c980c4...)

In an old forum entry from 2007 and I found a solution to stop the whole application to crash. (http://markmail.org/message/nkxy4dzhqqhnat6s#query:+page:1+mid:nkxy4dzhq...).

But I need to fix the problem because I need more than one instance of my scene graph. Currently I can only open one scene graph because with the second graph the following error ocurres.

CONTEXT_CREATION_ERROR: Renderer: Error creating Canvas3D graphics context
graphicsDevice = Win32GraphicsDevice[screen=0]
canvas = javax.media.j3d.Canvas3D[canvas1,0,0,899x770,invalid]
Java 3D ERROR : Canvas3D_createNewContext: Failed in SetPixelFormat - Das Pixelformat ist ung?ltig.
java.lang.IllegalStateException: Canvas3D: Non-recoverable graphics configuration error
at javax.media.j3d.Canvas3D.queryProperties(Canvas3D.java:3667)
at javax.media.j3d.Canvas3D.getStereoAvailable(Canvas3D.java:2964)
at com.sun.j3d.utils.universe.ViewInfo$CanvasInfo.getCanvasInfo(ViewInfo.java:3014)
at com.sun.j3d.utils.universe.ViewInfo$CanvasInfo.access$8000(ViewInfo.java:2859)
at com.sun.j3d.utils.universe.ViewInfo.updateCache(ViewInfo.java:2186)
at com.sun.j3d.utils.universe.ViewInfo.getPhysicalWidth(ViewInfo.java:1866)

Has anyone similar experience with Java 1.7? Does anyone know a work-a-round for this issue?

Thanks for your help,

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
sunflower1
Offline
Joined: 2008-09-18
Points: 0

Hi,

I found a solution for my problem. I was using a list of System properties for Java 3d and when I removed them my applications was running fine even with JKD 7.

This is my list of properties which I had to removed:

    System.setProperty("j3d.forceReleaseView", "true"); 
    System.setProperty("sun.java2d.d3d", "false");
    System.setProperty("sun.java2d.ddoffscreen", "false");
    System.setProperty("sun.java2d.noddraw", "true");
    System.setProperty("j3d.debug", "true");
    System.setProperty("j3d.sharedctx", "false");
    System.setProperty("j3d.cacheAutoComputeBounds", "true");
    System.setProperty("j3d.g2ddrawpixel", "true");
    System.setProperty("j3d.optimizeForSpace", "false");
    System.setProperty("j3d.threadLimit", "2");
    System.setProperty("j3d.usePbuffer", "false");

I am also running Java 3D embedded in a SWT application.

Patter
Offline
Joined: 2012-02-19
Points: 0

I also had problems after switching from Java 1.6 to 1.7 on Windows (Linux seems to be ok so far). The Canvas3D (only one for me) sometimes shows nothing - especially directly after start-up. Furthermore the application doesn't quit normally. In my case using a SWT_AWT frame to embed the canvas in a SWT-based application might introduce further complications. My solution so far was to switch back to 1.6 - so I'm sorry I do not have a solution for you...

regards,
Patter