Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2010
    Posts
    5
    Rep Power
    0

    Cool Java3D, Classpath, Path, Vista, and NetBeans

    Hi,

    I installed Java3D class to my hard-drive and re-configured my classpath and path in the environment variables section in my control panel (I am running Vista OS).
    The install instructions I used for the classpath and path were found in the download in the .zip file for the 3D class for 32bit windows at this location: https://java3d.dev.java.net/

    Then I reconfigured the Path, also in the environment variables following said instructions...

    I am following along a book, Killer Game Programming in Java, with a tutorial and am having problems getting one of the sample programs to compile and run that I am working on:

    Here is the code for said tutorial from said book:

    import com.sun.j3d.utils.timer.J3DTimer;


    public class TimerRes {

    public static void main(String args[])
    {
    j3dTimeResolution();
    sysTimeResolution();
    perfTimeResolution();


    }

    private static void j3dTimeResolution()
    {
    System.out.println("Java 3D Timer Resolution: " +
    J3DTimer.getResolution() + " nsecs");


    }
    private static void sysTimeResolution()
    {
    long total, count1, count2;

    count1 = System.currentTimeMillis();
    count2 = System.currentTimeMillis();
    while(count1 == count2)
    count2 = System.currentTimeMillis();
    total = 1000L * (count2 - count1);


    count1 = System.currentTimeMillis();
    count2 = System.currentTimeMillis();
    while(count1 == count2)
    count2 = System.currentTimeMillis();
    total += 1000L * (count2 - count1);

    count1 = System.currentTimeMillis();
    count2 = System.currentTimeMillis();
    while(count1 == count2)
    count2 = System.currentTimeMillis();
    total += 1000L * (count2 - count1);

    count1 = System.currentTimeMillis();
    count2 = System.currentTimeMillis();
    while(count1 == count2)
    count2 = System.currentTimeMillis();
    total += 1000L * (count2 - count1);

    System.out.println("System Time resolution: " +
    total/4 + "microsecs");


    }

    private static void perfTimeResolution()
    {
    StopWatch sw = new StopWatch();
    System.out.println("Perf Resolution: " +
    sw.getResolution() + " nsecs");

    sw.start();
    long time = sw.stop();
    System.out.println("Perf Time " + time +
    " nsecs");
    }

    }


    **Note - What is highlighted in yellow has a red squiggly line under it in NetBeans, indicating an error.

    My classpath is: .;es;C:\Program Files\Java\jdk1.6.0_19\lib;C:\Program Files\Java\jre6\lib\ext\QTJava.zip.;C:\Users\YourN ame\J3D\lib\ext\j3dcore.jar;C:\Users\YourName\J3D\ lib\ext\j3dutils.jar;C:\Users\YourName\J3D\lib\ext \vecmath.jar

    * I am 90% sure that the problem is with incorrect syntax of this classpath.

    My path is: bin;C:\Program Files\Java\jdk1.6.0_19/bin;C:\Program Files\QuickTime\QTSystem\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Users\YourName\J3D\lib\i38 6

    I am using NetBeans 6.9.1

    Any help would be awesome. :D

  2. #2
    Join Date
    Dec 2010
    Posts
    5
    Rep Power
    0

    Default

    I noticed that someone had a similar problem on this closed thread: Download java 3d lib

    I tried adding the .jar files for the Java3D to the NetBeans. Tools --> Libraries --> New Library --> Add Jar/Folder

    I also tried adding these to a folder in my JDK, not sure which one anymore... :/ :D

    Still NetBeans can not see the Java3D packages or classes or whatever. Any help would be greatly appreciated, it may be the only way I can get ET back home.

    I am going over this page on classpaths: Managing Source and Class Files (The Java™ Tutorials > Learning the Java Language > Packages) - as the one at JavaRanch, recommended in the closed thread, does not apply to Vista OS

  3. #3
    Join Date
    Dec 2010
    Posts
    5
    Rep Power
    0

    Default

    I figured this out... I downloaded the .exe and reinstalled the classpath and path following instructions from the site that offers the J3D class. Also the stopwatch class is obsolete unless using JDK 1.4.something... *thumbs up

Similar Threads

  1. Replies: 3
    Last Post: 08-14-2009, 12:57 PM
  2. how to set path and classpath on vista
    By pradnya in forum New To Java
    Replies: 6
    Last Post: 07-17-2009, 06:39 PM
  3. Setting classpath in Vista
    By dawiz001 in forum New To Java
    Replies: 2
    Last Post: 02-25-2009, 05:00 PM
  4. Path and classpath
    By nisheeth in forum New To Java
    Replies: 2
    Last Post: 12-23-2008, 12:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •