Launching a JAVAW application

T

The Frog

Hi Everyone,

I am hoping that someone can point me in the right direction as I keep
hitting my head against the wall with what seems to be a simple
problem.

I am using a batch file to launch a javaw app. The app sits quietly in
the background and waits for tasks to be sent to it, and returns the
results. From the batch it works fine, but it requires that someone
actually double click it to run the app.

What I would like to be able to do, is to launch the application at
system startup before a user logs in. The batch file currently used
does some processing to build the classpath statements and so on
before actually starting javaw. (If anyone is interested the
application is an open source project from Pentaho (www.pentaho.com)
called PDI (Pentaho Data Integration / Kettle), specifically the Carte
'slave' software).

I am hoping not to have to turn this into a Windows (XP) service, and
somehow launch the .bat file at system start. I have tried using group
policy and setting the startup scripts, and likewise directly in the
windows registry. So far I have had absolutely no luck at all.

If anyone has any ideas about this I would be most appreciative in
hearing them.

Cheers

The Frog
 
S

Stefan Rybacki

The said:
Hi Everyone,
...
If anyone has any ideas about this I would be most appreciative in
hearing them.

Put a shortcut to your batch file into the Start->Programs->Startup folder. But
still this is not a java question and there might be of course better ways to
achieve what you want.

Stefan
 
S

Stefan Rybacki

Lew said:
Stefan said:
The Frog schrieb: ...
Put a shortcut to your batch file into the Start->Programs->Startup
folder. But still this is not a java [sic] question and there might be
of course better ways to achieve what you want.

There is more than one "Startup" folder in Windows, one for "All Users"
and one for each user.
True, where the OP puts it if he considers this option is up to him. But thanks
for pointing that out.

Stefan
 
T

Thomas Kellerer

Stefan Rybacki, 17.10.2008 14:39:
Put a shortcut to your batch file into the Start->Programs->Startup
folder.

Which would still not launch the application *before* the user logs in, and that was the original question.

Thomas
 
T

Thomas Kellerer

The Frog, 17.10.2008 14:35:
What I would like to be able to do, is to launch the application at
system startup before a user logs in.

The only way to do this is to register your application as a Windows service that is automatically started at system startup.

There are solutions out there, which will make this quite easy.
Search for "java service wrapper"

Thomas
 
T

Thomas Kellerer

Lew wrote on 18.10.2008 01:09:
It doesn't have to be a service. Isn't it enough to put it in the
registry under a "Run" entry?
True, I always forget that one...

Thomas
 
T

The Frog

Thanks everyone for the help. I appreciate the attention you have
given my question. I have attempted to initiate the javaws app via the
batch file by creating a run key for it in the registry. It appears
that there is no luck in achieving a launch. I am using cmd.exe to
launch the .bat file, but perhaps I need to specify javaws in the run
key instead.

I will keep plugging away at this in the hope I can avoid the java
service wrapper solution. The java service wrapper approach can work,
but it is a lot of work to maintain with changing versions of
software. If the .bat / javaws can be launched directly it is just a
matter of swapping the folder contents which is a much simpler thing
to do and requires no specialised knowledge (ie/ I can leave it to the
in-house 'IT' group to manage).

@Roedy:
Thankyou for the suggestion from Mindprod, however I am not sure I
understand what is being said. Are you suggesting that the app be re-
engineered to an java web start app and launched that way? I was of
the belief that a 'standard' java app would need some re-working to be
able to achieve this. Is there a more rapid approach perhaps that I am
not aware of?

Thankyou all for the help and suggestions. I really do appreciate the
time and thought you have spared for this. I remain open of course to
any other suggestions you might offer.

Cheers and thanks

The Frog
 
T

The Frog

Well, the problem is solved. Its actually incredibly easy. In windows
(xp) click start -> settings -> control panel -> scheduled tasks. You
can add the task (the batch file) to run at system startup, and even
specify the username and password to use (if you want to get in to the
permissions thing).

Couldn't be easier. Oh, and if you want to do that remotely you can
use the AT command from the command prompt to set up the task on
remote computers (but you cant set the username and password - it uses
the default system account).

Cheers guys :)

The Frog
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,481
Members
44,900
Latest member
Nell636132

Latest Threads

Top