• 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
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

not even beginning

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is my first attempt at java, and I'm having trouble getting started.
I've been typing in examples from a book, and keep getting this error message when I run javac:
error: cannot read: MyFirstApp.java
1 error
Obviously, I spent hours checking for typos. Now I've read the page here on how to get started, copied the example code from this site in directly and even WIPED the whole thing clean- without altering this message at all!
I'm obviously doing something ELSE wrong.
I'm writing in textedit on mac osx 4, and javac is definately there. Should I be saving my java document somewhere in particular, or typing in fuller directions as to where it is located? I don't seem to be missing out any of the stages in the book I have.
I've tried the apple developers' site recommended, and am more confused than ever.
Just hoping someone might save me another 24hrs or so of stress and mounting confusion...
[ June 04, 2006: Message edited by: Bear Bibeault ]
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch!

It sounds like your file is not saved as plain text (it's probably rich text instead). Unfortunately, I'm on a Windows machine now, so I can't tell you the exact options -- I'll check this later tonight. I think you want to select "Plain Text" from the Format menu before saving. Then when you save, enter ".java" as the extension, and when TextEdit asks if you want to append or use the .txt extension, tell it that you're sure you want to use .java instead.

Also, note that we have a Mac OS forum specifically for Mac topics. I'll move this post there for you, so you can get expert Mac help.

Let us know how this works!
[ May 16, 2006: Message edited by: marc weber ]
 
Marshal
Posts: 67289
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
TextEdit is certainly not the best tool for the job. If you can't afford a decent IDE, I'd recommend one of the free ones, or the free TextWrangler text editor (from the makers of the most excellent BBEdit).
 
stella marsh
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ah yes, I am writing in plain text I should've said...Thanks for the tip about the text editor ,I certainly will check it out. I'd rather not be using textedit anyway. It seems I actually answeres my own question before- more complete filename working. Of course I am now on to the next problem...It is very late at night here. Sorry and thanks- felt I was going nuts there!
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, what did you do to solve this problem? Im using textwrangler and im still having the exact same problem
 
marc weber
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Scott Walker:
hi, what did you do to solve this problem? Im using textwrangler and im still having the exact same problem


TestWrangler should be saving in the correct format, so I'm guessing that the problem is in changing to the correct directory so that the file can be found. See my response under your other post, and let us know if that solves the problem.
 
stella marsh
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it was a question of it not being saved in the right directory. i could run the program by clicking on it directly, but it did not display in the command line. A friend of mine, who is a pro, added a new directory to my hd called 'work'. Now, I can change to that directory in the terminal window by typing myname/cd/work and write/run programs in there. I thought that was it, but havn't done any programming in 15yrs, so i was a bit lost!
Hope that helps.
 
stella marsh
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
to b more specific, i think this is answered better on the other discussion board- i,ve been busy writing a game in javascript & havn't touched this in a week or so. get a friend to help!! it's more fun that way- good to know i'm not the only muppet out there!
 
What kind of corn soldier are you? And don't say "kernel" - that's only for this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!