[vtkusers] install java and vtk on Windows

Jarek Sacha galicjan at yahoo.com
Fri Sep 13 15:25:44 EDT 2002

--- Marcelo Costa Oliveira <marcelo at cci.fmrp.usp.br> wrote:
> My steps was ( in Windows XP, java  and vtk4.0 )
> Cmake ( in attach )
> build vtk.dsw ( with visual c++ 6.0 )
> c:\jdk\bin\javac *.java ( in vtk\java\ )
> c:\jdk\bin\jar cf vtk.jar *.class ( in vtk\java\ )

This could be the problem. You should be issuing this command in a
directory one above where your vtk classes are located. That is
vtkConeSource.class and other VTK classes should be in the subdirectory
'vtk' of the directory where you are issuing your jar command. Your should
be able to create jar using command
  c:\jdk\bin\jar cf vtk.jar vtk/*.class

Use explorer or do this in the same directory where your are issuing your
jar command:

  dir vtk\vtkConeSource.class

This is to see if vtkConeSource.class is in correct place. If I understood
your CMakeCache the vtkConeSource.class is in C:\vtk\java\vtk\vtk\. Though
it is a bit inconsistent with your errors messages, see below.

> c:\jdk\bin\javac -classpath .;c:\vtk\java\vtk.jar SimpleVTK.java
> The problem:
> SimpleVTK.java:5: package vtk does not exist
> import vtk.*;
> ^
> SimpleVTK.java:19: cannot access vtkConeSource
> bad class file: c:\vtk\java\vtk\vtk.jar(vtkConeSource.class)
> class file contains wrong class: vtk.vtkConeSource
> Please remove or make sure it appears in the correct subdirectory of the
> classpa
> th.

There are two things that look suspicious. First, error message indicates
vtk.jar in c:\vtk\java\vtk\vtk.jar, the class path passed to the compiler
says c:\vtk\java\vtk.jar. Second, error message seems to indicate that 
vtkConeSource.class in the root directory of vtk.jar while it should be in
subdirectory vtk within vtk.jar. You can check where vtkConeSource.class
is  using WinZip or at command prompt type:
  jar cf c:\vtk\java\vtk.jar | more
If vtk.jar is correct there should be line

Hope this helps,


Do you Yahoo!?
Yahoo! News - Today's headlines

More information about the vtkusers mailing list