EventID: 4096 Could not initialize the Java Virtual Machine


We are able to start the java application from cmd line using run.bat
java_home is set in run.bat

I am setting java_home as part of windows service installation. I get below error when I try starting application as service. JVM is working fine when we run from cmd line. What am I missing?

EventID: 4096 Could not initialize the Java Virtual Machine
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Was anything about Symantec mentioned in the error or is that the full error?  I have seen this with a symantec error.
idforpg1Author Commented:
Nope, there is no symantec error. Above error is the full error from windows event logs
Mick BarryJava DeveloperCommented:
try adding some logging to your bat to get a better idea whats going on

and make sure you explicitly specify any paths in the bat that are needed. Its not the same as running it from a shell
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

idforpg1Author Commented:
Windows batch file is only used to create the windows service, service details along with parameters are stored in windows registry.

How can I debug the windows service?
Mick BarryJava DeveloperCommented:
what does the service actually run?
idforpg1Author Commented:
service runs a java application
Mick BarryJava DeveloperCommented:
i realise that, i mean what command
idforpg1Author Commented:
below is the command used in windows batch file to install application service:

cats.exe -install "VCats" %1\jre\bin\%3\jvm.dll -Xms512M -Xmx768M -Djava.class.path=%1\lib\tools.jar;%2\bin\run.jar;%2\lib\crimson.jar  -DCAT_HOME1=C:\\cats\\conf\\  -DCAT_HOME2=C:\\cats\\conf\\  -DCAT_HOME3=C:\\cats\\conf\\  -start org.jboss.Main -params -c cats  -stop org.jboss.Main -params tomcat -method systemExit -out %4\CatServer.log -err %4\CatServer.err -current %2\bin

%1: JDK home
%2: Jboss home
Mick BarryJava DeveloperCommented:
try include the fullpath to cat.exe
and why \\ is some places and not others?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java App Servers

From novice to tech pro — start learning today.