Wednesday, January 13, 2010

How Java was removed as dependency

As the last days I worked on the WPF integration I wanted to present a technological aspect that may be interested for some.

Rendering operation have some usages and advantages but the biggest problem in itself is that is no small rendering system out-there that is fairly decent and full-featured with a small runtime. So NaroCAD was somehow catched in a trap of having either to download a full blown renderer (like Povray) or to download other that have dependencies to Python or to Java. Cause of popularity of runtimes, the Java based renderer Sunflow was chosen (and easy integration to create polygon renders).

This Sunday I found a solution that do not depend on Java runtime. The solution was to provide with NaroCAD a Java virtual machine based on .NET (IKVM) which add to the install size around 25% of size (so the full package will grow from 19 to around 23M). The greatest part is not only that simplify the setup for user (why user should setup a Java virtual machine and to install it if does not exist on the final machine) as probably no user will do a more than two steps setup.

Studying more the IKVM project, I found that it can convert the Java bytecode (the .jar package) to a MSIL files (.exe .NET files) so sunflow.jar is right now as sunflow.exe. It have a lot of other advantages for user. like if you have installed Vista (or newer) OS (or XP with .NET 3.5 SP1 installed separately) you can run renderer and NaroCAD without any external runtime. So the single external runtimes that NaroCAD depends (OpenCascade, Lua and now IKVM .NET dlls) are bundled in the installer.

No comments: