This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 21 Developer (Exam 1Z0-830) Java SE 17 Developer (Exam 1Z0-829) Programmer’s Guide and have Khalid Mughal and Vasily Strelnikov on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Distributing a java application

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I have a very basic question.
I have a java application that currently starts via a main program. I want to distribute it to clients so that the application runs on all platforms continuously in the background.
I saw java service wrapper, but I couldn't figure out how to make a distributable file out of it.
I guess java web start would be another solution, but then again how do I make my application run in the background non stop (if it stops then I'd like the OS to restart it....much like a service).
Spent a whole day googling for the answer, but can't find a viable solution.

Thanks
Prnbs
 
Sheriff
Posts: 28401
100
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you mean by a "distributable program"? Everything is distributable, you don't have to do anything special.
 
Marshal
Posts: 80673
478
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch

Is thisof any help?
 
Pranabesh Sinha
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Paul Clapman -- My mistake. I meant that I want to pack my code maybe as an exe for windows or dmg for mac (I have already tried the obvious executable jar)

@Campbell Ritchie -- Thanks for the link. I have been looking at Java web start, but for my code to really work well, I'd like my code to run as a windows service and whatever the equivalent of that in other OS are. But as far as I have understood applications based on Java web start need some kind of user intervention to start (if say the pc was shutdown)
 
Sheriff
Posts: 22849
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use the Java Service Wrapper for that. Still, I think you'll need an installer for each platform, since installing services is not the same for all platforms. For instance, in Windows you need to register the service ("sc create <service name> <full path to the executable> start=auto DisplayName=" can be used, or you can use Windows API calls), while in Linux you need to create a starter file called S<2 digit number><name> in /etc/rc.d (I think it was this folder).
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic