• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

problem saving a file!!!!

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys,
when i try to save the file Say as Say.java,it is getting saved as Say.java.txt(till the reinstalling of my computer it used to be saved as a .java file).when i compile it,it's getting me the foll error,
"error:can't read:Say.java".
then i deleted the file and tried to compile it and it gives the same error as above, so i concluded that the saving as .java.txt could be a problem.
I've set the PATH and CLASSPATH as Richard had said.
could u pl help me out of this.
Thanks,
Elizabeth.
 
tumbleweed
Posts: 5089
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
javac works fith files ending with .java You really need to save you files as that only.
I got the same problem (.txt being added) when I used Notepad under windows 98.
I used to save my file as a text file and then renamed it to .java under explorer. Eventually I switched over to TextPad.
see this posting for some details TextPad.
Good luck

[This message has been edited by Johannes de Jong (edited June 07, 2001).]
 
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Eventually renaming the file (deleting .txt) suffices!
 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In Windows, you can always have a file saved as .xxx by putting quotes around the whole thing in the Save As window, e.g.: "Myfile.xxx". This will solve your problem.
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Or you can rename it in a DOS box by going to the subdirectory that contains the file ( cd\ {enter} cd C:\the path to the file {enter} ren Say.java.txt Say.java )
 
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Another way.
Change the file form Say.java.txt to Say.java as Marilyn suggested (You can use Windows Explore to do this as well).
Now from Windows Explore highlight the Say.java file (click once on it).
Once you have the file highlighted hold down the shift key and right click on the file.
This will give you a menu with one of the options being Open With. Click Open With.
You will get a dialogue box with a list of programs. Scroll down the list (or type Notepad) to Notepad. Highlight Notepad. Check the checkbox at the bottom that says "Always use this program to open this type of file".
This should allow you to save files with the java extension in Notepad without adding the txt to the end.
Let us know if you are still having problems.
 
village idiot
Posts: 1208
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is probably too simple, but I use Notepad as my text editor, and every once in a blue moon I forget to select the all files option in the save as type dialog box. Then I get the same problem. Check to see if you are selecting all files(*.*) when you are saving your file! Good luck!
 
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I do exactly what Carol does...works everytime.
------------------
I'm a soldier in the NetScape Wars...
Joel
 
Elizabeth Jacob
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
after posting the topic i had been out to the Dayton's daisy sale.i was so happy to see so many replies by the time i came back.i think i should get the things going now. Thanks to everyone of you.Marilyn thanks for the e-mail too.
Thanks,
Elizabeth.
 
Elizabeth Jacob
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hurray!!!
It worked.this was the first time,i was ever happy to see an error message after a file being compiled.that simple quotes thing worked.
thanks again.
Elizabeth.
 
Johannes de Jong
tumbleweed
Posts: 5089
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes Adam's tip sure was nice and simple.
The thread is a nice example of how we contribute together to solve someone's problem.
[This message has been edited by Johannes de Jong (edited June 07, 2001).]
 
Richard Boren
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My way means you never have to remember to use quotes, change the file type to all files, rename the file, etc. Notepad will always allow you to save a file with a java ext. without modifying the ext.; once you make Notepad the program to always open java ext. files.
I was using the all files type when Saving As from Notepad, but I kept forgetting to make the change before saving the file. Then I couldn't compile which just added to my frustration. It's hard enough writing code in Notepad; however, I'm getting where I can spot a { from a } and a ; from a : at a glance. Don't know if that means I'm becoming a better programmer though
 
Blood pressure normal? What do I change to get "magnificent"? Maybe this tiny ad?
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic