Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

My First Simple Java Code Execution  RSS feed

 
Tom Matys
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • 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.
 
Dave Trower
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • 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
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thank-You everyone. I will look at the last post with the tutorial, this will be very helpful.
 
Campbell Ritchie
Marshal
Posts: 55751
163
  • Mark post as helpful
  • send pies
  • 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 ]
 
Shaan Shar
Ranch Hand
Posts: 1249
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thank-You.
 
Campbell Ritchie
Marshal
Posts: 55751
163
  • Mark post as helpful
  • send pies
  • 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.
 
Rusty Shackleford
Ranch Hand
Posts: 490
  • Mark post as helpful
  • send pies
  • 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 ]
 
paramu iyer
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can try out Eclipse also.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!