• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Could not create Java Virtual Machine

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am attempting to execute a beginner's program and I get this error every time:

Could not create Java Virtual Machine
A fatal exception has occurred

What do I need to do to remedy this?

Thank you for your help.
 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What - EXACTLY - are you doing to get this error? What have you done?
 
Zach Christian
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

fred rosenberger wrote:What - EXACTLY - are you doing to get this error? What have you done?



I have [tried]running a java program I created in cmd. Directory of my source code: C:\Users\Me\Documents\Party.java

I am just typing javac Party.java then java -classpath.Party

here's the code:


 
Ranch Hand
Posts: 208
9
Eclipse IDE Firefox Browser Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looks like you've got some issues with the command to run java.

Should be(note the spaces)
java -classpath . Party

or just
java Party

Of course you're going to get a different error when you try that. You need to add a main method to your program, otherwise Java has no idea where to start. The main method can be something like this.


 
reply
    Bookmark Topic Watch Topic
  • New Topic