Results 1 to 11 of 11

Thread: NotePad

  1. #1
    whosadork is offline Member
    Join Date
    Sep 2008
    Posts
    29
    Rep Power
    0

    Default NotePad

    how do i use NotePad for java, like i cant figure out how to make a compiler, then what else do i do.
    I have eclipse but i also want notepad just for expirence.
    once i run it where does the compiler send the Compiled Files?

  2. #2
    gotenks05 is offline Member
    Join Date
    Sep 2008
    Posts
    34
    Rep Power
    0

    Default

    do you have JavaSE installed? Basically, just create the java file and open command prompt. First, you should make sure the java command works by typing "java -version", if it does not work then chances are that either JavaSE is not on your system or its not configured. you can download JavaSE from https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=jdk-6u7-oth-JPR@CDS-CDS_Developer"]here.

  3. #3
    Loop is offline Member
    Join Date
    Sep 2008
    Posts
    36
    Rep Power
    0

    Talking Reply

    Hey, why not get JGrasp or JCreator, they have have built in compilers?

    Must say, notepad isn't bad for writing fast programs...:o

  4. #4
    whosadork is offline Member
    Join Date
    Sep 2008
    Posts
    29
    Rep Power
    0

    Default

    yeah, lol and i like fast programs :)
    yeah i got it...
    what next?

  5. #5
    gotenks05 is offline Member
    Join Date
    Sep 2008
    Posts
    34
    Rep Power
    0

    Default

    Quote Originally Posted by whosadork View Post
    yeah i got it...
    what next?
    I'm not sure if this part was directed at my reply, but I'll assume you answered my reply. What you do is in command prompt, use go to the directory the file is in (make sure you know the full path) and type "cd C:\directory\sub directory\..." (replace sub directory and "..." with names of the directory) and then type "javac filename.java" (replace file name with the name of the file). If there are syntax errors, it should tell you (along with how many errors there are). If there are none, you can run your program by using "java filename" (replace filename with name of class file, leaving off the ".class" extension). That should be about it. Just be sure all files you want to compile are saved with the extension ".java".

  6. #6
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by whosadork View Post
    how do i use NotePad for java, like i cant figure out how to make a compiler, then what else do i do.
    I have eclipse but i also want notepad just for expirence.
    once i run it where does the compiler send the Compiled Files?
    First of all install latest JDK version in your machine. You can download it here for free of charge. Say you install it in C:\Java path.

    Then you have to set the class path. Since you are new to Java, for the first few Java application use the simple way. Open the command prompt and change the working directory to your working folder. I hope you know how to do it in command prompt. Then type the following to set the path.

    Java Code:
    path=C:\Java\jdk1.6\bin
    Actually the path is depends on your installation. Check that bin folder in the installation package, and replace that path the above path I've use. To check that's working fine or not, type javac. If you comes with a list of some options up to now everything id fine. At the time don't worry about those options.

    Then open a Notepad. Write a simple Java application, just to print a simple word. Then save the file with the extension java. File name should be equal as the class name. If the class name is Test the full file name should be Test.java, it can't contain txt part anywhere.

    Then compile the code. use javac Test.java command on the command prompt. If you get any compile errors fix them all. Then to run the Java code use java Test command, it gives the output your are looking.

    Keep in mind that Java is case sensitive. So javac and Javac are two different things.

  7. #7
    kellaw is offline Member
    Join Date
    Oct 2008
    Posts
    24
    Rep Power
    0

    Default

    try notepad++

  8. #8
    georgemc is offline Senior Member
    Join Date
    Sep 2008
    Posts
    135
    Rep Power
    0

    Default

    Quote Originally Posted by Loop View Post
    Hey, why not get JGrasp or JCreator, they have have built in compilers?

    Must say, notepad isn't bad for writing fast programs...:o
    Eclipse also has a built-in compiler

  9. #9
    georgemc is offline Senior Member
    Join Date
    Sep 2008
    Posts
    135
    Rep Power
    0

    Default

    Quote Originally Posted by Eranga View Post
    First of all install latest JDK version in your machine. You can download it here for free of charge. Say you install it in C:\Java path.

    Then you have to set the class path. Since you are new to Java, for the first few Java application use the simple way. Open the command prompt and change the working directory to your working folder. I hope you know how to do it in command prompt. Then type the following to set the path.

    Java Code:
    path=C:\Java\jdk1.6\bin
    Actually the path is depends on your installation. Check that bin folder in the installation package, and replace that path the above path I've use. To check that's working fine or not, type javac. If you comes with a list of some options up to now everything id fine. At the time don't worry about those options.

    Then open a Notepad. Write a simple Java application, just to print a simple word. Then save the file with the extension java. File name should be equal as the class name. If the class name is Test the full file name should be Test.java, it can't contain txt part anywhere.

    Then compile the code. use javac Test.java command on the command prompt. If you get any compile errors fix them all. Then to run the Java code use java Test command, it gives the output your are looking.

    Keep in mind that Java is case sensitive. So javac and Javac are two different things.
    Java might be case-sensitive, but the Windows shell isn't. So both javac and Javac will do the same thing. Not that that's any reason to go out of your way to be awkward to your OS though!

  10. #10
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Default editpad

    Quote Originally Posted by kellaw View Post
    try notepad++
    also Editpad, or better yet write Yet Another Editor. Notepad is limited to 4096 in earlier, though that has probably been bumped up. There is also a very primitive editor that can be run from the command line called,.."Edit" though I do not use it often. Consider BlueJ, dozens of IDE's avaliable which have good editors that will discover flaws in you code before you try to do a compile but I do not use them because they run way too slow for me. It is very common for me to open Notepad and do a copy-past from sample code in the browser to eliminate hidden control codes that I cannot see.

    With some effort, you can write a very primitive string processing tool that could recognize some very limited constructs, writing that tool with notepad and then going on to write an editor that would keep the "what editor are you using" thread from constantly bumping to the top. See that thread for a well-developed list of popular and not so popular editors along with discussion of the matter that will be very informative for chosing which editor you wish to use.

    Anyone having this question should study that thread.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  11. #11
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by georgemc View Post
    Java might be case-sensitive, but the Windows shell isn't. So both javac and Javac will do the same thing. Not that that's any reason to go out of your way to be awkward to your OS though!
    Yes it's my fault. I've replaying in two concerns. Normally I'm doing testings a lot in Knopix and there you can't Javac instead javac. Sorry for the incomplete replay, and thanks for the comment.

Similar Threads

  1. Reading data from Micrsoft excel and writing to notepad
    By abhishek.jain in forum New To Java
    Replies: 4
    Last Post: 01-29-2009, 09:12 AM
  2. Notepad or IDE?
    By Eranga in forum Other IDEs
    Replies: 30
    Last Post: 09-22-2008, 05:20 AM
  3. need help for my PROJECT(notepad system)
    By hrithik4568 in forum New To Java
    Replies: 0
    Last Post: 05-06-2008, 11:36 PM
  4. Creating a notepad application with java
    By Daniel in forum AWT / Swing
    Replies: 2
    Last Post: 07-02-2007, 06:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •