[vtkusers] How to obtain a vtk.jar compatible with Java 6

Sebastien Jourdain sebastien.jourdain at kitware.com
Thu Aug 1 09:24:05 EDT 2013


Hi Marco,

It seems that we even put -source 1.5

add_custom_command(
  OUTPUT ${VTK_BINARY_DIR}/java/javac_stamp.txt
  DEPENDS ${VTK_JAVA_SOURCE_FILES}
  COMMAND ${JAVA_COMPILE} ${JAVAC_OPTIONS}
    -source 1.5 -classpath
${VTK_JAVA_HOME}/..${SEPARATOR}${ECLIPSE_SWT_LIBRARIES} -sourcepath
${VTK_SOURCE_DIR}/Wrapping/Java/ -d ${VTK_BINARY_DIR}/java
    ${VTK_BINARY_DIR}/java/vtk/*.java
${VTK_BINARY_DIR}/java/vtk/rendering/*.java
${VTK_BINARY_DIR}/java/vtk/rendering/awt/*.java ${SWT_FILES}
  COMMAND ${CMAKE_COMMAND} -E touch ${VTK_BINARY_DIR}/java/javac_stamp.txt
  COMMENT "Compiling Java Classes"
  )

Unless you are not using VTK 6.

Seb


On Tue, Jul 30, 2013 at 11:56 AM, Marco Sambin <m.sambin at gmail.com> wrote:

> Hi all.
>
> I am building VTK 6 on Windows. From CMake, I generate MS Visual Studio
> 2010 projects for both 32-bit and 64-bit architectures.
>
> In CMake, I enabled Java wrapping, as I need to use VTK 6 from a Java
> application.
> I specify the path of the JDK version 7 which is installed on my
> development machine.
>
> The build process works fine, but I end up with a "vtk.jar" containing
> class files which are only compatible with JRE v7. Is there a way to
> specify some flags in CMake which would force the class files within
> vtk.jar to be built with the "-source 1.6" option of javac, forcing
> compatibility with JRE v6 or newer?
>
> One solution is obviously to install JDK 6 on my development machine, and
> have CMake build vtk.jar using that JDK.
>
> But I was wondering if there is a solution allowing me to use JDK 7 to
> build vtk.jar, still maintaining compatibility with JRE v6.
>
> Thanks in advance for your input.
> Best regards,
>
> Marco Sambin
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130801/3c49151c/attachment.htm>


More information about the vtkusers mailing list