How to create WindowsService or Unix daemon process for Java Application  

Posted by Krishna Chowdary

JavaService is an excellent tool for creating server-type Java applications to be run in the background as a Windows NT/2000/XP system service or as Unix daemon process.

JavaService provides an exe(which was developed using JNI and CPP). The core functions like start, stop, kill of webservice were written in that exe(JavaService.exe).

The EXE provide switches to install(JavaService install),start(net start), stop , kill windowsservice service.

Just by providing JVM path, Classpath in the jar file, memory to be allocated to the process we can make Java Application run as WindowsService

Here is it's link JavaService

Installer for Java applications  

Posted by Krishna Chowdary


I spend couple of days writing a windows installer for java application. Writing installer for java application is a bit complex compared to windows applications. All the classes in the project has to be jarred and a manifest has to be written pointing to entry class or main class of the jar.

I tried many freeware and sharewares like wrapper_win32_3.0, JSmooth, launch4j, JavaExe for writing installer.
Though these could generate a installer, but I couldn't find advance feature like folder creation and registry editing to text/binary file modification, modification of environment variables and system reboots etc., Then I found NSIS (Nullsoft Scriptable Install System). This is an excellent open source tool to create installers. It is capable of doing everything that is needed to setup a software. It is script based language allows you to create the logic to handle most complex installation taks. Many scripts and plug-ins are already available.

Within 4 hours I could able to learn the script and write a brand new and fully functional installer for my project. I could able to incorporate complex features like JRE check, read config settings from custom installer page and update those in respective config files, I could able to call Windows API's. I could able to initiate, start and stop of Window Service.

I can simply say this is the best tool for creating installer for DotNet as well as Java applications.

Bugmenot.com  

Posted by Krishna Chowdary


You're browsing the web and you click a link to an article on a site (let's say nytimes.com) but instead of getting the article you get a screen asking you to login or register. Infuriated at the idea of pointlessly registering for yet another site you turn to your good buddy bugmenot.com



Java application as a Windows Service  

Posted by Krishna Chowdary



From last 2 days I was busy in wrapping a Java application in a Windows Service. Tried many open source tools like Java Service Wrapper, J2Exe, JSL. But culdn't find a solution. Finally i found JavaService.Exe in one of the blogs. This is very easy to configure. After trying many tools, I felt this is the best tool to wrap Java application in a Windows Service.

Software and documentation can be found in 
http://forge.objectweb.org/projects/javaservice/

JavaService contains a Windows executable service that allows you to launch any Java application in a specified environment.
Copy JavaService.exe to your project and rename it to match whatever you want your service to be named (this is what you will see in the Windows Task Manager).

Next, you need to create a class to execute. JavaService can execute any application with a main() method, or you can specify a method to execute when the service starts. It must return void and accept as a parameter a String[].

Finally, you use the JavaService.exe file to install a Windows NT Service. This is accomplished by passing it a "-install" command line parameter followed by a set of additional parameters



Cygwin  

Posted by Krishna Chowdary


Today i got a requirement, where i have to run a linux apps in windows. Thought of going for a linux OS, but googled sometime to find a utility to do that. I found Cygwin which is a pretty good tool.It provides Linux-like environment for Windows. 
It consists of two parts:
  • A DLL (cygwin1.dll) which acts as a Linux API emulation layer providing substantial Linux API functionality.
  • A collection of tools which provide Linux look and feel.
These tools ports popular GNU development tools for Microsoft Windows.
With these tools installed, it is possible to write Win32 console or GUI applications that make use of the standard Microsoft Win32 API and/or the Cygwin API. As a result, it is possible to easily port many significant Unix programs without the need for extensive changes to the source code


Hi  

Posted by Krishna Chowdary

Hii,
This is my frist posting..I wanna share my personal feelings, work experience and technical issues i face day to day.