In this Tutorial we want to describe you a code that helps you in understanding a code ErrorcannotRead in java. For this we have a class ErrorcannotRead.In the main method we create an instance of class date.
Java error cannot read
The Java error cannot read occurred when a programmer do not follow the following condition-
- Putting files in the bin directory where the javac resides.
- The default home drive is C:\ go to cd\
- A programmer can make your personal room directory mkdir javaroom.
- Put your example with java extension file to my javaroom.
- Add a line to your autoexec.bat and reboot the machine.
SET CLASS PATH=.;C:\javaroom;%CLASSPATH%
(This means current directory )
('%CLASS PATH%' means existing CLASS PATH definition.)
- Go to javaroom directory
cd javaroom
- Javac MyFirstProgram.java
Java MyFirstProgram.
Here is the video tutorial of "How to solve cannot read file in Java?":
Understand with Example
In this Tutorial we want to describe you a code that helps you in understanding a code ErrorcannotRead in java. For this we have a class ErrorcannotRead.In the main method we create an instance of class date. The System.out.print ln is used to print the year by calling a method .get Year ( ).On execution the code show you an error Java Error cannot made Symbol. This error occurred because the programmer write the wrong class name on the command prompt. Therefore the compiler does not reconogised the class name and show you an error ErrorcannotRead.
ErrorcannotRead.java
|
Output
To resolve this error you have to give the proper file name of the java file.Here in the example our java file name is ErrorcannotRead.java and we are compiling file as ErrorcannotRead1.java
Download code