[vtkusers] Compilation problem with java

Daniel J. Blezek, Ph.D. blezek at crd.ge.com
Tue Jun 13 08:54:52 EDT 2000


David,

  Actually, you do not have to manually compile anything!  javac, unlike
CC resolves dependancies by itself, IF javac knows where you have already
compiled the classes.  Setting CLASSPATH or adding a -classpath flag to
javac tells javac how to resolve dependancies.

  If you try to compile things by hand as they crop up as errors, you'll
be at it a _long_ time (I know, I've tried).

-dan

On Tue, 13 Jun 2000, David D. Marshall wrote:

> I don't think this is the problem.  The problem is that the java classes are not compiled in the
> correct order.  The vtkProp.java file has not been compiled yet the Makefile is trying to
> compile the vtkActor2D class which inherits from vtkProp.  So until the Makefiles are fixed to
> compile in the correct order, a new person has to manually compile the classes by hand.  What
> worked for me was: javac -d {class_path} {vtk_home}/java/vtk/*.java.  Once you have the java
> classes compiled in the {class_path} directory, then you can use the Makefiles.
> 
> Slightly off topic but equally annoying is the fact the there are no dependencies in the
> Makefiles for the java compilation, so everytime you need to make the java libraries it will
> re-make all of the the java classes.  But since I'm not doing anything about it, I guess I
> should just shut up :).
> 
> Hope this helps.
> 
> "Daniel J. Blezek, Ph.D." wrote:
> 
> > Hi all,
> >
> >   This should be a FAQ...
> >
> >   javac will do the right thing if you tell it where to look for already
> > compiled classes.  The easiest way (and a bit of a hack) is to make your
> > user.make have a line like this:
> >
> > JAVA_CLASS_HOME= <path to java classes> -classpath <path to java classes>
> >
> > This tells javac to look in the same place for already compiled classes.
> > In the same way you can set the CLASSPATH environment variable to include
> > the place where you are putting the compiled classes:
> > (/scratch0/NOT_BACKED_UP/ucacdxa/TCLTk/VTKJavaClasses in the example
> > below).
> >
> > -dan
> >
> > On Tue, 13 Jun 2000, Suman Datta wrote:
> >
> > > hi all,
> > >       my problem is exactly the same ... not able to
> > > compile vtk on solaris ... somebody please advise how
> > > to solve this problem ...
> > >
> > > regards,
> > > suman datta.
> > >
> > >
> > > --- Olivier Coulon <o.coulon at cs.ucl.ac.uk> wrote:
> > > > Dear vtk users,
> > > >
> > > > I'm trying to compile vtk3.1 on Solaris2.7 using the
> > > > --with-java option
> > > > and I get an error as soon as the compilation of the
> > > > java classes
> > > > starts.  it seems that the compiler cannot find the
> > > > vtkProp class while
> > > > compiling vtkActor2D, which is weird because the two
> > > > files are in the
> > > > same directory.
> > > > Somebody has an idea what goes wrong ?
> > > >
> > > > - Olivier
> > > >
> > > >
> > > > Here is the messages I get:
> > > >
> > > > rm -f ../java/vtk/vtkObjectFactoryCollection.java;
> > > >
> > > /scratch0/NOT_BACKED_UP/ucacdxa/TCLTk/vtk31/wrap/vtkParseJava
> > > > ../vtkObjectFactoryCollection.h ./../wrap/hints 1 >
> > > > .../java/vtk/vtkObjectFactoryCollection.java
> > > >    Parsed func New
> > > >    Parsed func AddItem
> > > >    Parsed func GetNextItem
> > > >    Parsed func vtkObjectFactoryCollection
> > > >    Parsed func vtkObjectFactoryCollection
> > > >    Parsed func vtkObjectFactoryCollection
> > > >    Converted operator
> > > >    Parsed func AddItem
> > > > /opt/ucl/bin/javac -sourcepath
> > > > /scratch0/NOT_BACKED_UP/ucacdxa/TCLTk/vtk31/java/vtk
> > > > -d
> > > > /scratch0/NOT_BACKED_UP/ucacdxa/TCLTk/VTKJavaClasses
> > > > .../java/vtk/vtkActor2D.java
> > > > .../java/vtk/vtkActor2D.java:7: Superclass
> > > > vtk.vtkProp of class
> > > > vtk.vtkActor2D not found.
> > > > public class vtkActor2D extends vtkProp
> > > >                                 ^
> > > > 1 error
> > > > make[1]: *** [../java/vtk/vtkActor2D.class] Error 1
> > > > make[1]: Leaving directory
> > > > `/scratch0/NOT_BACKED_UP/ucacdxa/TCLTk/vtk31/common'
> > > > make: *** [build_common] Error 2
> > > >
> > > >
> > > > > begin:vcard
> > > > n:Coulon;Olivier
> > > > tel;fax:+44 (0)20 7387 1387
> > > > tel;work:+44 (0)20 7679 3702
> > > > x-mozilla-html:TRUE
> > > > url:http://www.cs.ucl.ac.uk/staff/O.Coulon
> > > > org:University College London;Computer Sciences
> > > > adr:;;Gower Street;London;;WC1E 6BT;United-Kingdom
> > > > version:2.1
> > > > email;internet:O.Coulon at cs.ucl.ac.uk
> > > > title:PhD
> > > > x-mozilla-cpt:;27200
> > > > fn:Olivier Coulon
> > > > end:vcard
> > > >
> > >
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Yahoo! Photos -- now, 100 FREE prints!
> > > http://photos.yahoo.com
> > >
> > > _______________________________________________
> > > This is the private VTK discussion list.
> > > Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> > > vtkusers mailing list
> > > vtkusers at public.kitware.com
> > > http://public.kitware.com/mailman/listinfo/vtkusers
> > >
> >
> > --
> > Daniel Blezek, Ph.D.
> > blezek at crd.ge.com
> > Computer Graphics and Systems Program
> > Electronic Systems Lab
> > GE Corporate Research & Development
> >
> > _______________________________________________
> > This is the private VTK discussion list.
> > Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> > vtkusers mailing list
> > vtkusers at public.kitware.com
> > http://public.kitware.com/mailman/listinfo/vtkusers
> 
> --
> David D. Marshall
> ARTLab System Administrator/GRA
> Georgia Institute of Technology, Atlanta Georgia, 30332
> http://www.ae.gatech.edu/research/artlab/artl/artlab.html
> mailto:gte552m at prism.gatech.edu
> think: Why anonymity is good http://www.cato.org/pubs/briefs/bp-054es.html
> 
> 

--
Daniel Blezek, Ph.D.
blezek at crd.ge.com
Computer Graphics and Systems Program
Electronic Systems Lab
GE Corporate Research & Development





More information about the vtkusers mailing list