• 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:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

My First Simple Java Code Execution

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to write my first Java code.Is it better to do it in wordpad or notepad? Better yet how do I do it in both?
How do I syntax check it and compile it.
Thank-You.
 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use either wordpad or notepad. Just make sure you save as a text file and the file must have .java extension.
The compile by:
javac yourfile.java
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See Sun's "Hello World" tutorial for Windows. This will take you though the steps of writing, compiling, and running.
 
Tom Matys
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank-You everyone. I will look at the last post with the tutorial, this will be very helpful.
 
Marshal
Posts: 80777
489
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Is it better to do it in wordpad or notepad?

Don't use WordPad or NotePad at all. Use something like JCreator. There is a version available free of charge. JCreator will do things like correct indentation, pairing off {} and (), and puts different components of the text in different colours, making it much easier to understand what your code is doing.
[ August 08, 2006: Message edited by: Campbell Ritchie ]
 
Ranch Hand
Posts: 1252
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Campbell Ritchie:
Don't use WordPad or NotePad at all. Use something like JCreator. There is a version available free of charge. JCreator will do things like correct indentation, pairing off {} and (), and puts different components of the text in different colours, making it much easier to understand what your code is doing.

[ August 08, 2006: Message edited by: Campbell Ritchie ]



I would never advise to a newbie in JAVA to use any editor as WSAD,JCreator etc.
This discourages them to learn some basic things in JAVA.

SO I would like to advise you to use Notepad for writing simple JAVA programs and then brush up with errors.

That will help you to learn Basics of JAVA and also programming.
I hope I didn't hurt anyone.
 
Tom Matys
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank-You.
 
Campbell Ritchie
Marshal
Posts: 80777
489
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

advise you to use Notepad for writing simple JAVA programs

. . . and spend more time counting {} and spaces than looking at the code?

WordPad and NotePad are not designed for programming; WordPad is a word processor, designed for writing letters. It is a lot easier to learn programming if you don't spend all your time and effort looking at trivial formatting errors. Or even worse, formatting errors which turn into syntax errors.
An experienced typist and programmer can use WP and plain text programs for editing the program, but beginners have quite enough to leanr without messing about with unsuitable tools.
 
Ranch Hand
Posts: 490
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
IDE's have a fairly steep learning curve, why fight the IDE when most beginners are struggling to learn the language and fighting the compiler? Besides, they hold your hand too much, imo, to be a very good learning tool for beginners.

I would not advise you to use notepad or wordpad either, they suck.

Try Crimson editor or Textpad. The first is free, the other is nagware, but both are great, and have very little learning curve. They do not automate brackets, but they will highlight pairs which makes it easy to catch missing/extra brackets. They also have syntax highlighting for many languages and you can make macros for often used lines of code, like main or System.out.println().

If you ever want to try linux, Kate or Tea are very comparable.

www.crimsoneditor.com
[ August 09, 2006: Message edited by: Rusty Shackleford ]
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can try out Eclipse also.
 
reply
    Bookmark Topic Watch Topic
  • New Topic