Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC 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:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

HelloWorld.java.txt  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,
I am very new at this and have yet to compile my HelloWorld program. I beliee the problem is with Windows Notepad/Wordpad. When I save the program I save it as HelloWorld.java and use the all files file type. However when it is saved it is saved as HelloWorld.java.txt. The compiler says the only error is that it can't read it. Any ideas on how to drop the .txt extension?
Thanks,
------------------
Greg
 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I might actually be able to help. You might need to set up a Java file extension so your editor will be prevented from incorrectly adding a .txt extension to .java files.
Open a folder in Windows and create a new text document by selecting File, New, Text Document from the folder menu bar.
Rename the file to Anything.java and confirm the choice when Windows asks.
Once you've created Anything.java, double click it. If your PC has never encountered the .java extension before, you'll see an Open With Window. You can use this window to associate the .java extension with your chosen word processor:
In the description of '.java' Files text box, enter Java source files.
In the 'Choose the Program You Want to Use' list box, scroll until you find the word processor you use to make java source files. If you don't find it, select 'Other' and find it manually.
Make sure that the 'Always Use This Program to Open This File' option is selected/checked.
You should be good to go. Tell me if it helps or not

Later.
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
whenever u save a file in notepad it saves it by default .txt extension. as such u cannot do what u do.
to overcome this enter the file to save as
"xxx.java" note enter the quotes as specified in the textfield.
this will solve u r problem
Rahul
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use double qoute like rahul_mkar said, it will work fine. However, I recommend Textpad or Kawa as your java editor, they are much better, and can save your alot of time.
 
Ranch Hand
Posts: 458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or simply save the file as type "All file *.*" and note pad won't add the *.txt
The PFE (Programmer's File Editor) is a free and nice little utility. Much better than notepad.
Find it at www.download.com
 
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or rename the file after you save it.
 
Greg St. Louis
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the help everyone. The double quotes worked. I am now going to download PFE and see if I like that. As you can tell I am just learnig and will probably be asking more questions. Again thanks for all the responses.

------------------
Greg
 
She said she got a brazillian. I think owning people is wrong. That is how I learned ... tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!