This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Java Error occurred during initialization of VM Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java Error occurred during initialization of VM " Watch "Java Error occurred during initialization of VM " New topic
Author

Java Error occurred during initialization of VM

Natalia Lopez
Ranch Hand

Joined: Feb 17, 2005
Posts: 41
Hi!
I'm trying to install tomcat5 on fedora

I did

yum install tomcat5
/etc/init.d/tomcat5 start

but when I go to http://myip:8080

The tomcat is not running
I can see on the logs:...

Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

How can I fix it?
Thanks a lot!
arulk pillai
Author
Ranch Hand

Joined: May 31, 2007
Posts: 3219
How much memory have you got in your machine?


Java Interview Questions and Answers Blog | Amazon.com profile | Java Interview Books
Natalia Lopez
Ranch Hand

Joined: Feb 17, 2005
Posts: 41
Hi
I have 1 Gb of RAM
Ramaswamy Srinivasan
Ranch Hand

Joined: Aug 31, 2004
Posts: 295
Well...seems like you have an improper installation of Java.

1. Remove Java installation from your machine, install it afresh and try again.

2. Write a simple hello world program and try compiling it. So that you will get more meaningful error message. It is a possibility that some variable is not properly set or something like that. Trace it down and remove.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

When you run a Java program, you can use the -Xmx switch on the command line to specify how much memory Java can allocate at most. For example, to let Java use up to 256 MB memory, run it like this:

java -Xmx256m com.mypackage.MyProgram

For Tomcat, have a look at the script that you use to start up Tomcat. I don't know exactly what it's called, probably tomcat.bat or catalina.bat in the bin directory of your Tomcat installation directory. You could add the -Xmx setting to the line in that script that starts Tomcat.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Error occurred during initialization of VM
 
Similar Threads
anyone - please - what's wrong with my path or classpath
VM can't recognize classpath when used with -Xrun
Eclipse, NoClassDefFoundError: java/lang/Object
Could not reserve enough space for object heap
Problem Uninstalling jdk-6u14-i586