jdk9+java3d in webstart

  • 진행 현황: Closed
  • 상금: $24
  • 응모작 접수(건수): 1
  • 수상자: giannitee

콘테스트 개요

We are seeking a way to compile and run the below Java3D program using
jdk9 on a mac.

1. You MUST have a mac (not virtual mac, but a real mac!).
2. You MUST have had experience working with Java3D
3. You MUST answer the following questions to show you have read this contest:
q1: What do you see when you type: java -version on the terminal app?
q2: What version of Java3d do you use?
q3: Where are you getting your version of Java3D?

I think I may be able to narrow down the issue;
jogl-all-natives-macosx-universal.jar

contains a jnilib that will crash when loaded into the jvm under jdk9.
For example:
public static void main(String[] args) {

System.load("/Users/lyon/current/java/j4p/jars/j3d/foo/natives/macosx-universal/libnativewindow_awt.jnilib");
}
Emits:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x0000000117a0a795, pid=65766, tid=6915

DO NOT bid higher than the maximum price.

import com.sun.j3d.utils.geometry.ColorCube;
import com.sun.j3d.utils.universe.SimpleUniverse;

import javax.media.j3d.BranchGroup;
import javax.media.j3d.Canvas3D;
import java.awt.*;


public class StillCube {


public StillCube() {

GraphicsConfiguration config =
SimpleUniverse.getPreferredConfiguration();

Canvas3D c3d = new Canvas3D(config);


// SimpleUniverse is a Convenience Utility class
SimpleUniverse su = new SimpleUniverse(c3d);

// This will move the ViewPlatform back a bit so the
// objects in the scene can be viewed.
su.getViewingPlatform().setNominalViewingTransform();

su.addBranchGraph(getBranchGroup());
Frame f = new Frame();
f.setLayout(new BorderLayout());
Panel p = new Panel(new BorderLayout());
p.add(BorderLayout.CENTER, c3d);
f.add(p, BorderLayout.CENTER);
f.setSize(200,200);
f.setVisible(true);
} // end of HelloJava3Da (constructor)

public BranchGroup getBranchGroup() {
// Create the root of the branch graph
BranchGroup bg = new BranchGroup();
bg.addChild(new ColorCube(.25));
bg.compile();

return bg;
} // end of CreateSceneGraph method of HelloJava3Da

// The following allows this to be run as an application
// as well as an applet

public static void main(String[] args) {
System.setProperty("sun.java2d.noddraw","true");
System.setProperty("sun.awt.noerasebackground", "true");
StillCube cube = new StillCube();


}

} // end of class HelloJava3Da

The winner will be hired to work on porting a java3d solution to webstart that will work with jdk9 as the sole jvm. This will be a long project.

There is an alternative set of libraries that might work on jdk9, but I was not able to get them working and represent another way to go (note the change in imports):
It is attached as "StillCube.java"

추천된 기술

고용주 피드백

“great freelancer. Looking forward to continued collaboration.”

프로필 이미지 douglaslyon, United States.

이 콘테스트의 최상위 응모작

다른 응모작

공개 설명 게시판

  • douglaslyon
    콘테스트 주최자
    • 6 년 전

    There appears to be no source code for java3d.

    • 6 년 전
  • douglaslyon
    콘테스트 주최자
    • 6 년 전

    # SIGSEGV (0xb) at pc=0x000000013734d0cc, pid=11082, tid=775
    #
    # JRE version: Java(TM) SE Runtime Environment (9.0+11) (build 9.0.1+11)
    # Java VM: Java HotSpot(TM) 64-Bit Server VM (9.0.1+11, mixed mode, tiered, compressed oops, g1 gc, bsd-amd64)
    # Problematic frame:
    # C [libosxapp.dylib+0x20cc] -[NSApplicationAWT sendEvent:]+0x179
    #
    # No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
    #
    # An error report file with more information is saved as:
    # /Users/lyon/current/java/j4p/hs_err_pid11082.log
    #
    # If you would like to submit a bug report, please visit:
    # http://bugreport.java.com/bugreport/crash.jsp
    # The crash happened outside the Java Virtual Machine in native code.
    # See problematic frame for where to report the bug.
    #

    Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

    • 6 년 전
  • douglaslyon
    콘테스트 주최자
    • 6 년 전

    Here is a typical crash; /Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home/bin/java --illegal-access=permit -Dfile.encoding=UTF-8 -classpath .../Users/lyon/current/java/j4p/jars/j3d/jogamp-fat/jogamp-fat-test.jar j3d.examples.shape.cube.StillCube --illegal-access=permit
    WARNING: An illegal reflective access operation has occurred
    WARNING: Illegal reflective access by javax.media.j3d.JoglPipeline (file:/Users/lyon/current/java/j4p/jars/j3d/jogamp-java3d/j3dcore.jar) to method sun.awt.AppContext.getAppContext()
    WARNING: Please consider reporting this to the maintainers of javax.media.j3d.JoglPipeline
    WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
    WARNING: All illegal access operations will be denied in a future release
    #
    # A fatal error has been detected by the Java Runtime Environment:
    #
    # SIGSEGV (0xb) at pc=0x00000001323fe0cc, pid=10875, tid=775

    • 6 년 전
  • douglaslyon
    콘테스트 주최자
    • 6 년 전

    /Library/Java/Extensions/ the contents of that directory has:
    gluegen-rt.jar jogl.jar libjogl_cg.jnilib
    j3d-readme/ libgluegen-rt.jnilib vecmath.jar
    j3dcore.jar libjogl.jnilib
    j3dutils.jar libjogl_awt.jnilib

    This is where I find: libjogl_awt.jnilib
    Then I thought, perhaps the layout of /System/Library/Frameworks/JavaVM.framework
    has changed with the new jdk..
    cd /System/Library/Frameworks/JavaVM.framework/Versions/Current/
    Commands/ JavaPluginCocoa.bundle/ Resources/
    Frameworks/ JavaVM* _CodeSignature/
    Headers/ Modules/
    I know nothing about Modules (except that they are optional and that I watched
    some youtubers try to explain it).
    ./Headers/jni.h
    ./Headers/jni_md.h
    ./Resources/.compatibility/libIASupport.jnilib
    looks like there is a jni remnant here.

    Hmm. Looks like a bunch of legacy jdirect stuff; com/apple/mrj/jdirect/
    14compatibility.jar IASupport.jar libIASupport.jnilib*

    • 6 년 전
  • douglaslyon
    콘테스트 주최자
    • 6 년 전

    Please know that we are trying to install java3d for the mac.

    • 6 년 전
    1. giannitee
      giannitee
      • 6 년 전

      "c:\Program Files\Java\jdk8\jre\bin\java.exe" -cp j3d.examples.boids.Main.jar j3d.examples.boids.Main
      loading:1.8.0_152
      c:\Program Files\Java\jdk8\jre\lib\ext;C:\WINDOWS\Sun\Java\lib\ext
      Exception in thread "main" java.lang.UnsatisfiedLinkError: no J3D in java.library.path
      at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
      at java.lang.Runtime.loadLibrary0(Runtime.java:870)
      at java.lang.System.loadLibrary(System.java:1122)
      at javax.media.j3d.MasterControl$22.run(MasterControl.java:891)
      at java.security.AccessController.doPrivileged(Native Method)
      at javax.media.j3d.MasterControl.loadLibraries(MasterControl.java:888)
      at javax.media.j3d.VirtualUniverse.(VirtualUniverse.java:233)
      at j3d.examples.boids.WrapFlocking3D.(WrapFlocking3D.java:55)
      at j3d.examples.boids.Main.(Main.java:88)
      at j3d.examples.boids.Main.main(Main.java:101)

      • 6 년 전
    2. giannitee
      giannitee
      • 6 년 전

      I made several more experiments... As I said, the best option would be to run a new executable JAR file that you should produce, which contains the manifest file denoting the main class and the main class requiring the appropriate JRE version. Repackaging the JAR file with the official tools seems to produce an error in relation to the signing. Starting over from the unpacked, compiled classes appears insensitive to the Manifest file fix; it appears runnable as a library... and still requires some J3D files in the path. Decompiled classes look like a nightmare. Abandon ship.

      • 6 년 전

다른 의견의 확인

콘테스트를 시작하는 방법

  • 콘테스트를 게시하세요

    콘테스트 등록 신속하고 간편한 절차

  • 응모작 접수

    응모작 접수 세계적인 참가 범위

  • 최우수 응모작 선정

    최우수 응모작 선정 자료 파일의 다운로드(초간단!)

콘테스트 바로 등록 (또는, 즉시 회원 가입!)