Download Links

Simulate 3D | SBW (Win32) | Bifurcation Discovery | FluxBalance
Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Sunday, November 11, 2012

Launch4j for 32bit

Launch4j is a great project, that can bundle java applications into an executable, so that starting these applications is no longer a problem. No batch files needed, no relying that the default extension for jars is starting them and no command line wizardry required. Launch4j would allow you to either bundle a JRE with your java application, or it could find it during runtime.

There was only one catch, you could not let it know that what you do want it to find is a certain architecture of JRE. See, when your project would use JNI and your native libraries are only available in 32 bit architecture, then running the project with a 64bit JVM would just not work.

Thanks to the wonders of open source, the full code for launch4j is publicly available from SF, so it was no problem to fork the project and add an option to the launcher that would allow it to find 32 bit JVMs first.

A new installer is available on github!, grab it here:

http://fbergmann.github.com/launch4j/files/SetupLaunch4j_3.0.3.exe

Screenshot

Sunday, October 21, 2012

Using LibSBML from Tomcat

I frequently hear that it would be difficult to use libSBML from Tomcat. So I figured I take some time to investigate what the problems could be. In the process I rewrote the SBML Online Validator to use libSBML java bindings and tomcat. It turned out that libSBML is actually easy enough to set up to be used by tomcat, one just has to take certain particularities of the java programming language (with respect to P/Invoke ) into account:

  • libraries can only be loaded once
  • native resources can only be accessed from the thread that created them
  • you have hardly any control of the garbage collection, however all native classes have to be freed on the same thread as they were created on
  • be careful that your elements do not go out of scope (i.e.: even if you are working with SBML Models, you can not let the SBML Document get out of scope)

I’ve written all this up and published it on github, it would be great to hear what you think about it. There you will find: