super newb to java

Hey i just started learning java today and i downloaded the jdk version 1.2.1 and I can't figure out how to work it. could some help me.
«1

Comments

  • Does anyone know a good site to learn java from for free? or a book


    : Getting started guide:
    : http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.html
    :
    : ---------------------------------
    : [size=1]HOWTO ask questions: http://catb.org/~esr/faqs/smart-questions.html[/size]
    :
    :

  • Try this tutorial:
    http://www-106.ibm.com/developerworks/edu/j-dw-javaessentials-i.html

    You have to register for it, but that's free. It is a very good tutorial that'll learn you the basics of Java.

    Hope this helps you.

    --=][tReShR][=--

  • You can try this, too:

    www.sleepinggiantsoftware.com/FGJ

    Is slanted toward games, but has step-by-step instructions that take you from installing Java to writing your first programs using an IDE.

    Good luck,

    K.


    : Try this tutorial:
    : http://www-106.ibm.com/developerworks/edu/j-dw-javaessentials-i.html
    :
    : You have to register for it, but that's free. It is a very good tutorial that'll learn you the basics of Java.
    :
    : Hope this helps you.
    :
    : --=][tReShR][=--
    :
    :

  • I would also advise you to use Eclipse for developing Java apps.
    it is totally free, and it has some interesting features that makes programming a lot easier.

    You can download it at: http://www.eclipse.org

    Good luck.

    --=][tReShR][=--

  • How do i set a variable to hold more then one letter. I am trying to set it to [code]char Var = Hello;[/code] but its giving me an error.

    : I would also advise you to use Eclipse for developing Java apps.
    : it is totally free, and it has some interesting features that makes programming a lot easier.
    :
    : You can download it at: http://www.eclipse.org
    :
    : Good luck.
    :
    : --=][tReShR][=--
    :
    :

  • Rather than using a char, use a String -- it's designed to hold a "string" of letters:

    [code]
    String word = "Hello";
    [/code]

    Give that a whirl.

    K.


    : How do i set a variable to hold more then one letter. I am trying to set it to [code]char Var = Hello;[/code] but its giving me an error.
    :
    : : I would also advise you to use Eclipse for developing Java apps.
    : : it is totally free, and it has some interesting features that makes programming a lot easier.
    : :
    : : You can download it at: http://www.eclipse.org
    : :
    : : Good luck.
    : :
    : : --=][tReShR][=--
    : :
    : :
    :
    :

  • Hey I cant run java programs. i can compile them with the javac command and to run the program i know you u use java command but it still doesnt work for me. does anyone have any suggestions.
  • Hey HR,
    Please post again, and include the exact command you're entering when you try to run the program, as well as any error messages that you get as a result.
    With that information, we ought to be able to get you up and running.
    Hope to hear from you soon,

    Kreitler


    : Hey I cant run java programs. i can compile them with the javac command and to run the program i know you u use java command but it still doesnt work for me. does anyone have any suggestions.
    :

  • heres what i am doing:

    java HelloJava


    But there is no error messages its just waits a little and then does nothing. Also here is the code:

    [code]
    class HelloJava
    {
    public static void main(String args[])
    {
    System.out.println("Hello Java!");
    }
    }
    [/code]


    : Hey HR,
    : Please post again, and include the exact command you're entering when you try to run the program, as well as any error messages that you get as a result.
    : With that information, we ought to be able to get you up and running.
    : Hope to hear from you soon,
    :
    : Kreitler
    :
    :
    : : Hey I cant run java programs. i can compile them with the javac command and to run the program i know you u use java command but it still doesnt work for me. does anyone have any suggestions.
    : :
    :
    :

  • HR,
    Hmm...that's perplexing. You're doing everything correctly, as near as I can tell. Just to be safe, I compiled and ran the code on my machine, and it seemed fine.

    The fact that there is a long pause after you type java HelloJava is suspicious. The only time I experienced that was when Java produced an Exception because it couldn't find the associated class. It's possible (though unlikely) that the same thing is happening to you, but the exception info isn't getting printed (maybe there's a bug in the version of Java you're using).

    A good first step to troubleshooting this is to make sure that Java is installed correctly. What operating system and version of Java are you running? Also, when you installed, did your PATH variable get updated so that it points to Java? If not, you should update the PATH by hand so that it does point to the version you installed. This could be creating all sorts of strange problems, otherwise.

    Let me know if you have questions about or problems with the procedure.

    Kreitler


    : heres what i am doing:
    :
    : java HelloJava
    :
    :
    : But there is no error messages its just waits a little and then does nothing. Also here is the code:
    :
    : [code]
    : class HelloJava
    : {
    : public static void main(String args[])
    : {
    : System.out.println("Hello Java!");
    : }
    : }
    : [/code]
    :
    :
    : : Hey HR,
    : : Please post again, and include the exact command you're entering when you try to run the program, as well as any error messages that you get as a result.
    : : With that information, we ought to be able to get you up and running.
    : : Hope to hear from you soon,
    : :
    : : Kreitler
    : :
    : :
    : : : Hey I cant run java programs. i can compile them with the javac command and to run the program i know you u use java command but it still doesnt work for me. does anyone have any suggestions.
    : : :
    : :
    : :
    :
    :

  • I am running on windows xp, using Java 2 SDK, Standard Edition
    Version 1.4.2 and I have the path set to: C:j2sdk1.4.2in.

    thanks for your help




    : HR,
    : Hmm...that's perplexing. You're doing everything correctly, as near as I can tell. Just to be safe, I compiled and ran the code on my machine, and it seemed fine.
    :
    : The fact that there is a long pause after you type java HelloJava is suspicious. The only time I experienced that was when Java produced an Exception because it couldn't find the associated class. It's possible (though unlikely) that the same thing is happening to you, but the exception info isn't getting printed (maybe there's a bug in the version of Java you're using).
    :
    : A good first step to troubleshooting this is to make sure that Java is installed correctly. What operating system and version of Java are you running? Also, when you installed, did your PATH variable get updated so that it points to Java? If not, you should update the PATH by hand so that it does point to the version you installed. This could be creating all sorts of strange problems, otherwise.
    :
    : Let me know if you have questions about or problems with the procedure.
    :
    : Kreitler
    :
    :
    : : heres what i am doing:
    : :
    : : java HelloJava
    : :
    : :
    : : But there is no error messages its just waits a little and then does nothing. Also here is the code:
    : :
    : : [code]
    : : class HelloJava
    : : {
    : : public static void main(String args[])
    : : {
    : : System.out.println("Hello Java!");
    : : }
    : : }
    : : [/code]
    : :
    : :
    : : : Hey HR,
    : : : Please post again, and include the exact command you're entering when you try to run the program, as well as any error messages that you get as a result.
    : : : With that information, we ought to be able to get you up and running.
    : : : Hope to hear from you soon,
    : : :
    : : : Kreitler
    : : :
    : : :
    : : : : Hey I cant run java programs. i can compile them with the javac command and to run the program i know you u use java command but it still doesnt work for me. does anyone have any suggestions.
    : : : :
    : : :
    : : :
    : :
    : :
    :
    :

  • Where do you create your apps in. Try to use an editor like Eclipse to create your classes and everything. For me it's the best IDE that I can think of and it's free.

    You can download it at http://www.eclipse.org.

    Maybe that IDE can tell you what to do with your prog.

    --=][tReShR][=--

  • I ran my test on Java2 (v1.4.1) under XP, so we're almost identical.
    Try compiling and running the following program. When you run it, use the following command line:

    [red]
    c:j2sdk1.4.2injava HelloJava
    [/red]

    [code]
    public class HelloJava {
    public void main(String[] args) {
    System.out.println("*
    ");
    System.out.println("*
    ");
    System.out.println("*
    ");
    System.out.println("Fred ate bread.
    ");
    System.out.println("*
    ");
    System.out.println("*
    ");
    System.out.println("*
    ");
    }
    }
    [/code]

    I realize this is pretty much the same program, but...
    ...by including newline characters (
    ) and a bunch of asterisks, I'm hoping that you'll actually see something come out on the console.

    If this combination of code and command line works, then go back to your regular command line ("java HelloJava") and see if that works. If it does, then recompile your old class and try it again (maybe after adding a newline to the end of your print statement).

    If the new code/new command line works but the new code doesn't work with your original command line, you've probably got an installation problem that we need to sort out.

    Also, Tresher's suggestion about using Eclipse is a good one, once we get this figured out. Eclipse will simplify your life quite a bit, and it's free. If you decide to go that route, I've got a small pdf that will walk you through installing and creating a simple program inside Eclipse.

    Keep us posted.

    K.


    : Hey i just started learning java today and i downloaded the jdk version 1.2.1 and I can't figure out how to work it. could some help me.
    :

  • Hey that worked, thanks alot. I downloaded eclipse and wen i click on the exe to install it, it gives me an error. i took a ss of it:

    http://www.bluethrust.com/leo/ERROR.jpg





    : I ran my test on Java2 (v1.4.1) under XP, so we're almost identical.
    : Try compiling and running the following program. When you run it, use the following command line:
    :
    : [red]
    : c:j2sdk1.4.2injava HelloJava
    : [/red]
    :
    : [code]
    : public class HelloJava {
    : public void main(String[] args) {
    : System.out.println("*
    ");
    : System.out.println("*
    ");
    : System.out.println("*
    ");
    : System.out.println("Fred ate bread.
    ");
    : System.out.println("*
    ");
    : System.out.println("*
    ");
    : System.out.println("*
    ");
    : }
    : }
    : [/code]
    :
    : I realize this is pretty much the same program, but...
    : ...by including newline characters (
    ) and a bunch of asterisks, I'm hoping that you'll actually see something come out on the console.
    :
    : If this combination of code and command line works, then go back to your regular command line ("java HelloJava") and see if that works. If it does, then recompile your old class and try it again (maybe after adding a newline to the end of your print statement).
    :
    : If the new code/new command line works but the new code doesn't work with your original command line, you've probably got an installation problem that we need to sort out.
    :
    : Also, Tresher's suggestion about using Eclipse is a good one, once we get this figured out. Eclipse will simplify your life quite a bit, and it's free. If you decide to go that route, I've got a small pdf that will walk you through installing and creating a simple program inside Eclipse.
    :
    : Keep us posted.
    :
    : K.
    :
    :
    : : Hey i just started learning java today and i downloaded the jdk version 1.2.1 and I can't figure out how to work it. could some help me.
    : :
    :
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories