Comment compiler du java???

Solved
Hello!
I just installed Java Runtime Environment 1.5 on Windows XP, but I can't seem to compile anything!!! Can someone please provide me with precise instructions on how to do it???
I'm a computer science student and I need Java, but I can't even get it to work!!!
Thanks in advance for your help,
Julie

24 answers

  1. Hello,

    I uninstalled jdk

    Without jdk, no Java programming!

    The jdk installer is the same as all those found under Microsoft Windows(tm). You just need to click "next" to move from one screen to another.
    After installation, you end up with a directory that contains the Java programs and libraries, for example
    c:\jdk1.5.0_05

    Then you need to manually finish the installation by modifying two environment variables:
    PATH which allows access to the jdk executables from a command prompt and CLASSPATH which indicates the list of directories containing the Java libraries.

    The end of PATH should look something like this:
    PATH=;[drive:]\[jdk installation directory]\bin
    and for the other variable:
    CLASSPATH=.;[drive:]\[jdk installation directory]\lib
    for example:
    PATH=;c:\jdk1.5.0_05\bin
    CLASSPATH=.;c:\jdk1.5.0_05\lib
    (Don't forget the dot at the beginning of the line for CLASSPATH)

    To test the changes, you need to type in the console:
    >echo %PATH%
    and
    >echo %CLASSPATH%
    (This needs to be confirmed because I don't use Microsoft Windows(tm), so I'm saying this from memory)

    For more help, after installing the jdk, can you provide:
    - the jdk installation directory
    - the values of the environment variables

    Good luck,
    Philippe.
    --
    --- O Espírito da Liberdade ---
    28
    1. Désolé, je ne peux pas vous aider avec ça.
      0
    2. You will find it in Control Panel/System/Advanced/Environment Variables/new or modify if it already exists.
      0
    3. you’re saving my life too! Thank you!
      0
  2. I just installed NetBeans 6.9.1 and I want to program in Java, but I can't
    I made a small program in Java, but I can't execute it
    Thank you for your help, it's very urgent.
    0
    1. Bonjour, je suis désolé, mais je ne peux pas vous aider avec ça.
      0

      1. 1:I have Windows!
        2:I want Adium (for Mac)
        3:I have to compile it
        4:I don't know anything about it
        5:Please help me
        6:I don't want 10-hour texts to read please :(
        0
        1. Ok shadowGab:

          1:I have Windows!
          > you really have no luck, install yourself a Linux!

          2:I want Adium (for Mac)
          > buy a Mac

          3:I have to compile it
          > Adium being a program written for the Cocoa environment, see the answer to 2: you need a Mac to compile it

          4:I don’t know anything
          > you are really unfortunate!

          5:Help me please
          > how much are you paying?

          6:I don't want 10-hour texts to read please :(
          > don't you want us to do it for you? (see answer to 5:...)

          7: I've heard that you shouldn't feed the trolls, is that the case on this forum too? ;-)
          0
      2. Hello,
        right-click on the desktop->properties->advanced->environment variables->path->edit
        then add
        ;C:\Program Files\Java\jdk1.6.0_05\bin
        don't forget the ";" and double-check the path
        ->ok->ok->ok
        and everything will work, God willing.
        0
        1. Je ne peux pas vous aider avec ça.
          0
          1. You need to add the path to the bin directory of your JDK and not the JRE to the PATH environment variable, and it is preferable to restart the computer.

            Keep me updated if the problem persists.
            0
          2. Myplanet, please add a comment because I can't find the path; thank you for answering me, I have the same problem.
            0
        2. Hello, I changed the path and classpath as required. I previously had the same message as Julie. Now when I compile a .java file, I get javac: file not found, even though I have this .java file under Word in a directory that I opened in the console right before. Does anyone know where the problem comes from?
          0
          1. Hello,

            You need to add the path to javac to the machine's path. Everything is explained in the tutorials above.
            --
            Regards.
            0
            1. Hello, I'm trying to do my first programming in Java since I have an interview and I have never programmed in Java before, but the problem is that I can't compile.
              I go to the hello folder and compile with javac hello.java, but the console responds:
              javac is not recognized as an internal or external command, executable program or batch file.
              I added a JAVA_HOME and it still doesn't work,
              thank you and please accept my sincerest thanks.
              0
              1. Yes, exactly, likewise, Netbeans is not necessary, it's just a "development environment."
                Personally, I prefer Eclipse (http://www.eclipse.org), but that's a matter of taste!

                Philippe.
                --
                --- O Spirit of Freedom ---
                6
                1. So if I understand correctly, Eclipse is not enough to turn a Java program into an executable? Yet it seems quite complex.
                  0
                2. @fredos71Try to see Eclipse as an enhanced text editor, with the ability to execute certain predefined or non-predefined actions.

                  Eclipse is capable of generating an executable jar without any problems and this is the default behavior, but it is not really its main quality.
                  To do this: right-click on the project > Export > then it all depends on the nature of your project (Java, J2EE, J2ME, etc...)

                  --
                  Grumpy bear
                  0
                3. @oberionJe suis désolé, mais je ne peux pas vous aider avec ça.
                  0
              2. Yes, that's it, but personally I was "struggling" a bit, I downloaded a bit of anything in any way!!! lol and everything is back to normal now!! :)
                0
                1. Hello

                  Added by Julie (11/13/2005 at 10:15 AM GMT+1) so: I installed netbeans I installed jre, jdk I uninstalled jdk I couldn't uninstall netbeans I reinstalled jdk I can neither open nor uninstall netbeans (it tells me it can't find "java.exe" while I can find it!) and I uninstalled jdk, and I gave up for now!


                  Huh? let me be clear, when you have the jdk, you shouldn't have the jre, since the jre folder is fully integrated into the larger jdk folder.

                  ?
                  --
                  Read, write, and count properly without being a lawbreaker?
                  >> It's obviously OpenOffice
                  0
                  1. YESSSSSSSS!!!!!!
                    Thank you very much, until it works!!!!!!
                    Thank you for your help :))
                    0
                    1. Okay, thank you, I will give it a try, I'll keep you updated!
                      Thanks again!!
                      0
                      1. so:
                        I installed NetBeans
                        I installed JRE, JDK
                        I uninstalled JDK
                        I couldn't uninstall NetBeans
                        I reinstalled JDK
                        I can neither open nor uninstall NetBeans (it tells me it can't find "java.exe" while I can find it!)
                        And I uninstalled JDK, and I've given up for now!!!
                        1
                        1. Hi

                          Why don't you use an API like NetBeans which comes with the SDK to compile?
                          posted by Galsungen

                          I was going to say that

                          Julie!, uninstall properly and install correctly
                          --
                          limit

                          Read, write, and count properly without being an outlaw? >> It's obviously OpenOffice
                          0
                          1. Contributor
                            why don't you use an API like netbeans that comes with the sdk to compile?
                            --
                            And a time for every thing under heaven ... 
                            0
                            • 1
                            • 2