[vtkusers] vtk and Java

Jarek Sacha galicjan at yahoo.com
Tue Aug 20 18:11:33 EDT 2002


At 05:14 PM 8/20/2002, you wrote:
>Running in Borland JBuilder 60 - Java under XP Pro
>
>1. I Rebuild the project and the build succeeds.
>2. Project runs fine when the lines below are commented out.
>      // vtkConeSource cone = new vtkConeSource();
>      // cone.SetHeight( 3.0 );
>      // cone.SetRadius( 1.0 );
>      // cone.SetResolution( 10 );
>3. when // vtkConeSource cone = new vtkConeSource(); is uncommented, the
>build fails with the following error.
>"cone02.java": Error #: 300 : class vtkConeSource not found in class
>cone02.cone02 at line 27, column 6
>
>4. I thought the import vtk.*; and System.loadLibrary() should get me beyond
>this point, but I must be missing something!

Compiler error suggests that you do not have vtkConeSource in your 
classpath. A strange thing is that must have something in from 'vtk' 
otherwise you will get compilation error at 'import vtk.*;'

Verify the classpath you program is seeing by adding following to your code:
System.out.println("classpath="+System.getProperty("java.class.path"));
And rerun you code.

If you do not see vtk.jar in the classpath. Then that is what you are 
missing. Add it and ignore rest of this message :)

If you see vtk.jar in the classpath then since you did not get compilation 
error at 'import vtk.*;' chances are that you have an incomplete vtk.jar. 
Check if you have vtkConeSource in subdirectory vtk in the vtk.jar (You can 
open a jar file with JBuilder, that is probably the easiest way. You can 
also with WinZip or using command prompt 'jar -tvf vtk.jar').

Hope this helps to get you on track,

Jarek





More information about the vtkusers mailing list