Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • 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
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

compile error

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,
I'm compiling a little program and receiving the following error.
Error occurred during initialization of VM
Could not reserve enough space for object heap
I assume that VM stands for Virtual Machine, but not too sure about object heap. Any ideas??
 
Brodie Patten
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It probably has something to do with the fact that my PC at work sucks. I'll reboot and try again. Still interested in the term 'object heap'.
 
Sheriff
Posts: 16767
281
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Probably refers to the portion of memory allocated to a process in which objects "reside" at runtime. If you read about the String class, you will run across the term "string pool" and "heap" as in:

Bartenders and Sheriffs, do I understand it right?
J. Lacar
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pretty darn close!

sp is in the Constant Pool (which is usually in ROM).
a new String containing "bar" is created on the heap (in RAM: Brodie this is what your problem is - just not enough of it)
However ss is not an object. It is a variable that is holding an object. Variables get created in the stack (which is also in RAM)
 
Brodie Patten
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Me again,
I rebooted and now I'm receiving a new error. Even for my HelloWorld script, which was running properly, I'm receiving this error. I can compile the programs, but when I run them I receive the error:
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Ojbect
I installed Opera with the Java package bundled with it. I'm wondering if this is part of the problem.
 
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What kind of computer and what platform are you working on?
Your JRE may be too beefy for your hardware.
Or ... the Java package that came with Opera may be fluff. You should go to java.sun.com/products and download a new JDK or JRE.
Hope this helps
------------------
Chris Stehno (Sun Certified Programmer for the Java 2 Platform)
 
Cindy Glass
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the Opera app reconfigured your path and classpath, you might get such and error. Check them out and either put them back the way you want them or do your testing from the opera directories.
 
Brodie Patten
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the help. You were correct, Opera must have reconfigured my classpath. I edited it and my program ran properly.
Thanks again.
 
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
could someone explain the use of API document
and how to use it
thx
 
Cindy Glass
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The J2SE API is a JavaDoc document providing information about all of the classes that come with the J2SE JVM. You use it to look up what methods are available in each class and how you can structure the constructor when creating an instance of each class etc. Unfortunately most of us mortals can not memorize the entire API, so we keep a reference to it handy at all times.
There is an API document for each of the specialty areas also. There is an API doc for the 3D package that you can add on to the basic java classes, and another for Java Security, etc.
Mostly I just keep a link to the plain API in my favorites and run off to read parts of it on a daily basis.

 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic