Announcement

Collapse
No announcement yet.

Help! My computer refuses to amend the java path.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help! My computer refuses to amend the java path.

    Every time I try, it pretends that it has saved the changes, but it really hasn't. If I close the command prompt and open it again, I get the original path. This happened even when I tried overwriting the path rather than appending it. It is almost like something is always rewriting the path, no matter what I do. Needless to say, I can't run any java classes from batch files or the command prompt until this is fixed. Does anyone know what to do here? Thanks.
    Attached Files

  • #2
    Can't you use JBuilder (or whatever) to chage the path?

    Comment


    • #3
      Originally posted by reds4ever
      Can't you use JBuilder (or whatever) to chage the path?
      EDIT: sorry, drunk and didn't read the question properly

      Comment


      • #4
        In XP:

        System Properties > Advanced > Environment Variables > System > Path > Edit

        I recommend doing the actual editing in a text editor because the text box is tiny.

        Yes, I do think they made it this difficult to find just to spite Java. This was much, much easier before XP.
        Blog | Civ2 Scenario League | leo.petr at gmail.com

        Comment


        • #5
          I haven't counted, but perhaps your path is too long? IIRC, you can only have 128 characters worth of path stored.

          You can also change the path in your autoexec with msconfig.
          (\__/) 07/07/1937 - Never forget
          (='.'=) "Claims demand evidence; extraordinary claims demand extraordinary evidence." -- Carl Sagan
          (")_(") "Starting the fire from within."

          Comment


          • #6
            Thanks guys. I wiped out a couple of the Oracle paths and it saved the new path. Unfortunately, that did not solve the central problem. While I can run things through an IDE, I still cannot run anything from the command prompt or a batch file. It gives me the same error as before. I made sure that the path is right, and I can't figure out what else it might be.
            Attached Files

            Comment


            • #7
              Maybe you need to set something else in the path?
              (\__/) 07/07/1937 - Never forget
              (='.'=) "Claims demand evidence; extraordinary claims demand extraordinary evidence." -- Carl Sagan
              (")_(") "Starting the fire from within."

              Comment


              • #8
                There is a java.exe program in the C:\j2sdk1.4.2_01\bin folder. I got all of this to work in about 15 minutes in the computer lab, and we had to set the path manually on those computers too. What else might I need to put in the path?

                Comment


                • #9
                  Do you need to specify an extension? Would it assume a ".class" extension if you supply none?
                  (\__/) 07/07/1937 - Never forget
                  (='.'=) "Claims demand evidence; extraordinary claims demand extraordinary evidence." -- Carl Sagan
                  (")_(") "Starting the fire from within."

                  Comment


                  • #10
                    The java command interprets any period as a command to look in a subfolder. Asking to run "Psychiatrist.class" made it look for a class named "class" in a "Psychiatrist" folder. In all the labs and batch files I've seen, the .class extension is never typed.

                    Comment


                    • #11
                      Found this on Sun's Java website

                      Error Explanation

                      Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldApp

                      If you receive this error, java cannot find your bytecode file, HelloWorldApp.class.

                      One of the places java tries to find your bytecode file is your current directory. So, if your bytecode file is in C:\java, you should change your current directory to that. To change your directory, type the following command at the prompt and press Enter:

                      cd c:\java

                      The prompt should change to C:\java>. If you enter dir at the prompt, you should see your .java and .class files. Now enter java HelloWorldApp again.

                      If you still have problems, you might have to change your CLASSPATH variable. To see if this is necessary, try "clobbering" the classpath with the following command:

                      set CLASSPATH=

                      Now enter java HelloWorldApp again. If the program works now, you'll have to change your CLASSPATH variable.
                      (\__/) 07/07/1937 - Never forget
                      (='.'=) "Claims demand evidence; extraordinary claims demand extraordinary evidence." -- Carl Sagan
                      (")_(") "Starting the fire from within."

                      Comment


                      • #12
                        Clobbering the classpath worked. I changed it permanently in the Control panel, and now everything works right. I have no clue how the classpath got changed before. Thanks.

                        Comment


                        • #13
                          (\__/) 07/07/1937 - Never forget
                          (='.'=) "Claims demand evidence; extraordinary claims demand extraordinary evidence." -- Carl Sagan
                          (")_(") "Starting the fire from within."

                          Comment


                          • #14
                            Oracle

                            I noticed you had Oracle installed. The Oracle installer changes the Classpath. It thinks that Oracle Java is the version you want to run and overrides whatever is there.
                            “It is no use trying to 'see through' first principles. If you see through everything, then everything is transparent. But a wholly transparent world is an invisible world. To 'see through' all things is the same as not to see.”

                            ― C.S. Lewis, The Abolition of Man

                            Comment

                            Working...
                            X