Results 1 to 20 of 20
  1. #1
    chipp's Avatar
    chipp is offline Member
    Join Date
    Jul 2011
    Posts
    62
    Rep Power
    0

    Default totally beginner

    i'm totally new to java. and i found that what i've learn in java.sun.com is different syntax when i write it in eclipse IDE. can anyone give me somekinda guidelines or somethin'?

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,519
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by chipp View Post
    i'm totally new to java. and i found that what i've learn in java.sun.com is different syntax when i write it in eclipse IDE. can anyone give me somekinda guidelines or somethin'?
    Have you studied the Java 1.6 tutorials and set the compiler level to 1.6 in Eclipse?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    chipp's Avatar
    chipp is offline Member
    Join Date
    Jul 2011
    Posts
    62
    Rep Power
    0

    Default

    no (i guess)

  4. #4
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,519
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by chipp View Post
    no (i guess)
    For Eclipse you can set the compiler level if you go to Projects > Properties > Java Compiler; for those tutorials, all I can say is, read the Java 1.6 tutorials (the others are outdated).

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    Dark's Avatar
    Dark is offline Senior Member
    Join Date
    Apr 2011
    Location
    Camp Lejuene, North Carolina
    Posts
    643
    Rep Power
    4

    Default

    Eclipse will default to 1.6 every time you make a new project, so that's probably set up correctly.

    Is this the site you are using to learn Java from?
    The Really Big Index
    • Use [code][/code] tags when posting code. That way people don't want to stab their eyes out when trying to help you.
    • +Rep people for helpful posts.

  6. #6
    chipp's Avatar
    chipp is offline Member
    Join Date
    Jul 2011
    Posts
    62
    Rep Power
    0

    Default

    alright i'll try.
    @dark: i learn it from java.sun.com (well actually, i copy the entire documents and wanna start to learn it at the house, bu then i found it doesn't work (don't like the syntax from the compiler given))

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

    Default

    If you are totally new to Java, why don't you just use the notepad and the command prompt for some period of time? Then you can have a better idea, and later move to an IDE.

  8. #8
    chipp's Avatar
    chipp is offline Member
    Join Date
    Jul 2011
    Posts
    62
    Rep Power
    0

    Default

    how to do that? sounds cool :D

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

  10. #10
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    It's a bit more difficult; since you are navigating and doing much more by yourself, but it is very helpful for the learning process.

    You can use a really primitive text editor(notepad), or a slightly more advance one(I personally love notepad++), which offers syntax highlighting. From there you just write your code in the text editor of choice and save it somewhere you can remember. I for one create a folder off the C drive called javacode and inside that I have another folder called snippets, I save snippets in there, and make new folders for other projects. It will look like this: C:\javacode\snippets

    Once you have done this you can save your .java files into the snippets folder and open up the command prompt(start->run->cmd), and use cd, and dir to navigate your way around. To get to the above created folder you would type something like "cd \javacode\snippets", and you can use dir to view what is in the current directory.

    Once in the directory with the saved .java files you can compile and run them with javac, and java.

    If you have the following file saved as Hello.java in the snippets folder you would do this:
    Java Code:
    public class Hello{
      public static void main(String[] args){
        System.out.println("HELLO!");
      }
    }
    Java Code:
    cd \javacode\snippets
    Java Code:
    javac hello.java
    Java Code:
    java Hello
    If you did everything correctly, you should see HELLO! printed on the cmd line. If this doesn't work; come back and tell us where you ran into problems. I, as well as others, will more than likely be glad to help you out.

  11. #11
    amanrv is offline Member
    Join Date
    Jul 2011
    Posts
    12
    Rep Power
    0

    Default

    well, i've found this particular site JSP Tutorials,EJB Tutorial,JDBC Tutorials,Free Java Servlets Tutorials, WAP Tutorials, Spring Framework Tutorials, J2EE Tutorials, BioInformatics Tutorials, Java Server Faces Tutorials, Jboss Tutorials, Hibernate Tutorials, XML and MySQL Tutorials really helpful. the explanations are simple, though there are a few grammatical errors here and there, it doesn't matter as long as you understand your stuff.

    moderator note: Rose India is a crappy site; ignore the link.
    Last edited by JosAH; 07-21-2011 at 11:44 AM. Reason: small warning added ...

  12. #12
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default

    @World: amanrv's link is to a notoriously bad site full of misinformation. Do not follow it.

  13. #13
    chipp's Avatar
    chipp is offline Member
    Join Date
    Jul 2011
    Posts
    62
    Rep Power
    0

    Default

    i got stuck in:

    javac hello.java //ordinary error, 'javac' is not recognized bla bla bla...

    what should i do? download java environment?

  14. #14
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,798
    Rep Power
    7

    Default

    Read how to set your environment variables.

  15. #15
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    Assuming you already downloaded the Jdk, you need to set your path; the easiest way to do this is navigate to the folder containing javac (something like c:/program files/java/Jdk/bin) and right click anywhere the javac file is, go to properties and copy the address.

    Then do: start->right click computer-> properties-> advanced-> environment variables(this may be slightly off)

    At top if you don't have a PATH variable, create one and add the copied address into it.

    It's also helpful to set the classpath below by adding:
    Java Code:
    .;\javacode
    Assuming you followed my above post.

    Check this link for a video walkthrough that I learned to set this up:
    TheNewBoston – Free Educational Video Tutorials on Computer Programming and More! Java Programming Tutorial – 1 – Installing the JDK

    Let me know if you get stuck anywhere.

  16. #16
    chipp's Avatar
    chipp is offline Member
    Join Date
    Jul 2011
    Posts
    62
    Rep Power
    0

    Default

    done, thank you. :)

    @sunde: do you mean like this:

    C:\Program Files\Java\jdk1.5.0_22\bin.;\javacode

    //do we have to write "javacode" or is it refer to our java code
    Last edited by chipp; 07-22-2011 at 09:08 AM.

  17. #17
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    The long path goes in a variable for the user called PATH, where as the other stuff goes below in the CLASSPATH, you don't need javacode, just point it to where you store your java code. The . Sets the class path to the current working directory.

    You could also not set the classpath and use

    Java Code:
    javac -cp .;javacode file.java
    where javacode is the directory you store the java code in, you can have only one item(.), or multiple as shown above. The semi colon will allow you to add another.

  18. #18
    chipp's Avatar
    chipp is offline Member
    Join Date
    Jul 2011
    Posts
    62
    Rep Power
    0

    Default

    i'm curious, what the jdk does? i have jre in my computer not jdk, and only an IDE (eclipse) and i even compile code. so what jdk does?

  19. #19
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,519
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by chipp View Post
    i'm curious, what the jdk does? i have jre in my computer not jdk, and only an IDE (eclipse) and i even compile code. so what jdk does?
    Eclipse is more than a JDK; it is an IDE; Sun's/Oracle's JDK has only command line tools; Eclipse can do much more than that. If you have Eclipse, you don't need any other JDK but it can come in handy now and then ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  20. #20
    chipp's Avatar
    chipp is offline Member
    Join Date
    Jul 2011
    Posts
    62
    Rep Power
    0

Similar Threads

  1. Replies: 2
    Last Post: 12-13-2010, 11:25 PM
  2. Totally lost with reading excel
    By nkk in forum New To Java
    Replies: 4
    Last Post: 09-13-2010, 10:15 AM
  3. please help me,,,, i m totally confused
    By uday shankar singh in forum AWT / Swing
    Replies: 3
    Last Post: 04-10-2010, 03:26 AM
  4. I'm lost, totally(pointer exceptions?)
    By helpisontheway in forum New To Java
    Replies: 4
    Last Post: 12-01-2009, 06:41 AM
  5. Replies: 1
    Last Post: 09-04-2008, 09:07 AM

Posting Permissions

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