Link to home
Start Free TrialLog in
Avatar of richardsimnett
richardsimnett

asked on

how do I make a java app load at windows startup?

Hello,
How do I get a java program to run at windows startup. I dont mean login, I mean when the os boots. I have an app that needs to come up and down with the box its run on.

Thanks,
Rick
ASKER CERTIFIED SOLUTION
Avatar of zzynx
zzynx
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Put your .jar file into the Autoexec.bat file in the C:\
Avatar of richardsimnett
richardsimnett

ASKER

zzynx,
I have tried the devx referral you gave, the other 2 seemed too complicated for me. Anyways, I have this exe that j2winservice generated. I have installed the service and tried to run it, and all my odbc connections fail. Meanwhile, I can run the jarfile with no problem at all. Can you lend any suggestion on how to fix this? or possibly how to find out how to fix it?

The errors I get are these:

mpPmtaFeeder Started.
Config Loaded.
jdbc:odbc:mailprosatdata1-m6d2y77
Database Connection Error:java.sql.SQLException: [Microsoft][ODBC Driver Manager
] Data source name not found and no default driver specified

DB ExecuteQuery
Database Read Error: java.lang.NullPointerException


Database Close Error: java.lang.NullPointerException

DB CLose()
Database Connection Error:java.sql.SQLException: [Microsoft][ODBC Driver Manager
] Data source name not found and no default driver specified

java.lang.NullPointerException
        at MPFeeder.run(MPFeeder.java:45)


Strange as it is, this runs perfectly as a standalone jar. Are services somehow limited from interacting with ODBC?

Thanks,
Rick
>> Are services somehow limited from interacting with ODBC?
No real experience with that.
But I think a service does run under a "special account".
Maybe that's the problem.

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Triguna,
The datasource is setup properly in ODBC. As I stated the program works perfectly from the command prompt... but when I try to load it as a service it craps out on me.

Thanks,
Rick
Thanks for accepting
Thank you for Assisting.