This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Can't compile file

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) I can't compile my java files in DosPRMPT.I get answer:"can't read java SomeFile.java.
2) I can compile it by Run (menu Start), but consol window is closing so fast that I can't read it if there are errors.
 
Rancher
Posts: 1449
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To possibly prevent the console window from closing before you can see what is going on you can add this to the end of your main function.
try
{
System.in.read();
}
catch(Exception e)
{
System.out.println("Exception caught: " + e.getMessage());
}
This code waits for you to type a character, carriage return, etc.
I assume you are catching and displaying any exceptions you might catch in your current code.
 
Nataly Golovachev
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You,John, for you help!
I'm working now on "catching".
What about DOSPRMPT,I can now compile Java files. The thing was in path (and in that I'm new in computers).
 
Ranch Hand
Posts: 320
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This actually would only help keeping the Java aplication open if you were 'running' or 'executing' it, not when compiling.
I say check your 'path', check your 'classpaths' and compile the program (.java) file in the directory that it resides.
You should have no problems after that.
G'luck
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!