Results 1 to 12 of 12
- 08-22-2008, 04:05 PM #1Member
- Join Date
- Aug 2008
- Rep Power
cannot read file while compiling!!!
i had just started with java.
while compiling, error is that it cannot read file.
i has saved file with .java extension.
i have installed sdk2toolkit & i have done all possible things to set path of bin folder(via cmd & using environment variable).
- 08-22-2008, 05:04 PM #2
Please copy and paste here full text of console showing commandline and error message.
- 08-22-2008, 07:16 PM #3
- 08-22-2008, 09:21 PM #4
I have seen this problem occurring many times.At times our source files gets saved with name XXX.java.txt instead of being XXX.java if you are using notepad as your editor.You will not even realize it if your files extensions are not shwing.
Assuming that you are using an ASCII plain text editor like note pad to write your java programme...make sure that while saving the file you enclose the name within double quotes...like "XXX.java".
Hopefully that will solve the issue..unless you are not compiling the java file from a location where it actually does not exist.
- 08-23-2008, 03:01 AM #5
Actually in most of the case files saved as *.java.txt, the file extension *.java is not registered in the system. So the system automatically directed to the *.txt file extension, when you are working with the notepad.
In that case you no need to use double quotes. If the *.java file extension is not registered you can solve it using double quotes as you mentioned.
- 08-23-2008, 03:50 AM #6
- 08-23-2008, 05:30 AM #7
As a Java newbie better to use Notepad, and emacs for linux users. Later on better to move with an advance Java IDE like, Notepad. fishtoprecords, I'm confusing that why are you advice not to use Notepad.....
- 08-23-2008, 05:37 AM #8
There are tons of free simple editors for all known operating systems that are not as broken as notepad.
For years, I've used VIM on windows, aka vi
And if you like graphical stuff, there is gvim
Notepad is evil. There are hundreds of thousands of better programs to do trivial editing
I know that several of the regulars here recommend trivial editors and manual compilation, but I've found that using something like NetBeans is much easier to get folks started. Getting the classpath right, getting the options to the compiler, etc. are things that get in the way of writing an "hello world" program.
- 08-23-2008, 05:53 AM #9
- 08-23-2008, 05:59 AM #10
If I were a fresher to Java...I would choose a editor which does nothing for me apart from allowing me to write on it and save it(like notepad).That will brush up my skills.
- 08-23-2008, 06:07 AM #11
folks tend to either love or hate emacs. I never saw any reason to spend the time learning it, and it has a non-trivial learning curve.
We'll have to agree to disagree. I've found Netbeans to be trivial to download, install and then you do a "file -> new -> java -> main class"
and you are ready to rock.
If you want something easy to get started in, use Smalltalk
- 08-23-2008, 12:02 PM #12
You are right, it's not difficult to create a main class and work on NetBeans. But not just that only, most of the people doesn't know how to handle command line arguments. Some doesn't know how to attach an additional jar files. How to working with multiple project as a single application...... and many more.
- By nitinmukesh in forum NetworkingReplies: 6Last Post: 06-03-2012, 08:45 PM
- By Java Tip in forum Java TipReplies: 0Last Post: 02-08-2008, 09:13 AM
- By tajinvillage in forum Threads and SynchronizationReplies: 0Last Post: 01-29-2008, 09:10 AM
- By Amit Kr. Mishra in forum New To JavaReplies: 0Last Post: 11-06-2007, 10:41 AM
- By sureshsri1981 in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 08-05-2007, 03:49 PM