File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes JVM-Error: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "JVM-Error: "cannot read: incdem.java" Watch "JVM-Error: "cannot read: incdem.java" New topic
Author

JVM-Error: "cannot read: incdem.java

Thomas Markl
Ranch Hand

Joined: Mar 08, 2001
Posts: 192
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
rani bedi
Ranch Hand

Joined: Feb 06, 2001
Posts: 358
May be while compiling you misspelt the java file. This error comes only when it can't find the specified java file.


Cheers,<br />Rani<br />SCJP, SCWCD, SCBCD
Thomas Markl
Ranch Hand

Joined: Mar 08, 2001
Posts: 192
I know my mistake now.
I put it in in the wrong directory so the JVM couldn't find it.
Thomas M.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JVM-Error: "cannot read: incdem.java