This week's book giveaway is in the Artificial Intelligence forum.
We're giving away four copies of Pragmatic AI and have Noah Gift on-line!
See this thread for details.
Win a copy of Pragmatic AI this week in the Artificial Intelligence 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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

JVM-Error: "cannot read: incdem.java  RSS feed

 
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I compile "javac incdem.java" there's the error message
as follows:
cannot read: incdem.java
It can't have anything to do with DOS-path etc. because
other programms compile without error.
I think the JVM doesn't understand the code.
Please help
Thanks.

class incdem
{
public static void main(String args[]) {
int x;
int y;
x = 1;
x = x++;
System.out.print(x + "\n");
x = 1;
x = ++x;
System.out.print(x + "\n");
x = 1;
x = x--;
System.out.print(x + "\n");
x = 1;
x = --x;
System.out.print(x + "\n");
}
}
=> This code compiles with "cannot read error: incdem.java"
------------------------------------------------------------
class incDe
{
public static void main(String args[]) {
int x;
int y;
x = 1;
x++;
System.out.print(x + "\n");
x = 1;
++x;
System.out.print(x + "\n");
x = 1;
x--;
System.out.print(x + "\n");
x = 1;
--x;
System.out.print(x + "\n");
}
}
This code compiles correctly and results in:
2
2
0
0
 
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be while compiling you misspelt the java file. This error comes only when it can't find the specified java file.
 
Thomas Markl
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know my mistake now.
I put it in in the wrong directory so the JVM couldn't find it.
Thomas M.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!