Browse DevX
Sign up for e-mail newsletters from DevX


Build "Win-tuitive" Java Applications : Page 4

You can make your cross-platform Java application more intuitive for Windows users. Learn how enabling access to the tray bar and programming your application to act as a Windows Service provides this functionality.




Building the Right Environment to Support AI, Machine Learning and Deep Learning

Exercise 3: Run a Java Server as a Windows Service
To create a Windows Service, use the J2WinService component of the J2Exe download and simply repeat the same instructions you followed with J2Exe in the first part of the "Exercise 1: Develop a Simple Java Application with Its Own .exe" section. However, after reviewing your "Input" options and before choosing your "Output" options, select "Service" (See Figure 8) and enter the following additional information:
  1. Service name: MyServer
  2. Service description: MyServer Description
  3. Interact with the desktop: checked
  4. Service type: Service that runs in its own process

Start type: Service started on demand or Service started automatically during system startup.

Figure 8: Service Options
To install this service, write "MyServer /install" in the command prompt. To uninstall it, write "MyServer /uninstall".

Find Your Application's Balance
Java's power is its platform independence, but it comes at a cost—the specific features of each platform. The best approach is to build platform-independent applications that preserve the platform-specific features of their target environments. I hope this article helps you to find that golden balance.

Alexi Jordanov is a software developer with more than 10 years experience. He is currently based in Sofia, Bulgaria, where he is a project leader for the OSGi technology company ProSyst Bulgaria.
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date