• 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
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Where do I type code?

 
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried using textedit (iBook G4) and save it as rtf or word format. Then I go to the console and rename the file to .java... However I get a compile error saying about an illegal character? I get this in almost every line... Am I using the wrong tool? Thanks!
 
Ranch Hand
Posts: 2102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the software you used to write the code, can produce different types of files. only the 'text only' format is okay for java. pure text.

after you type the code, save it in 'text only'.

some formats like rtf or doc, adds characters that java compiler doesnt need.
 
author and iconoclast
Posts: 24203
43
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't save code as .doc or .rtf -- you must save it as plain text, same as on any other platform. You may need to go to the "Format" menu and choose "Make plain text" before saving. You can set "Plain Text" as the default for new documents under "TextEdit | Preferences..."
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Heero Yuy:
I tried using textedit (iBook G4) and save it as rtf or word format. Then I go to the console and rename the file to .java... However I get a compile error saying about an illegal character? I get this in almost every line... Am I using the wrong tool? Thanks!



Why don't you try JEdit at www.jedit.org - a nice, easy to use, platform independent text editor?
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Graham Lewis:
... Why don't you try JEdit at www.jedit.org - a nice, easy to use, platform independent text editor?


Hmmm... I might give that another try now that I've switched to Mac. (On Windows, JEdit kept getting associated with incorrect file formats, including audio and graphic files. This was the only app that did this, so I uninstalled just to keep it from launching all the time.)
 
Graham Lewis
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by marc weber:

Hmmm... I might give that another try now that I've switched to Mac. (On Windows, JEdit kept getting associated with incorrect file formats, including audio and graphic files. This was the only app that did this, so I uninstalled just to keep it from launching all the time.)



Hi Marc - did you use the JEditLanucher package? I've not used this (at least not knowingly), but according to the JEdit FAQ's this allows file types to be associated with JEdit - so double-clicking an icon will try to load that file type in JEdit. I've always just used a 'standard' install with no problems - Mac OS X, Windows and Linux! All the best.
Gray
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you considered Eclipse (eclipse.org)? I have an iBook G4 with 768MB of RAM and find Eclipse to be far and away more productive than a text editor.
 
marc weber
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Graham Lewis:
...did you use the JEditLanucher package? ...according to the JEdit FAQ's this allows file types to be associated with JEdit - so double-clicking an icon will try to load that file type in JEdit.


I don't recall whether I used the launcher (since I was trying all sorts of IDEs and editors at the time), but that definitely sounds like it might have caused the problems. I finally settled on Eclipse as an IDE, although I still find myself using TextEdit for small programs and tests because it's so quick and easy. If I try JEdit again, I'll be sure to use the standard install. Thanks!
 
This cake looks terrible, but it tastes great! Now take a bite out of this tiny ad:
Enterprise-grade Excel API for Java
https://products.aspose.com/cells/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!