10 Replies Latest reply: Sep 14, 2010 1:48 AM by PhHein RSS

    The system cannot find the path specified - Problems

    843789
      I am having an issue that I am hoping someone can help figure out for me.

      I am currently learning Java, and am working with the Beginning Programming with Java for Dummies book second edition. I have downloaded and am running the Java 6 program and am using the JCreator 3.5Pro that was recommended to run the Practice files for the Dummies book.

      I have the practice files here:
      C/Program Files/Xinox Software/JCreatorV3/My Projects

      While trying to compile one of the practice files, I get this error message:

      --------------------Configuration: MyNewProject - JDK version 1.6.0_21 <Default> - <Default>--------------------
      javac: file not found: src_mynewproject.txt (The system cannot find the path specified)

      Process completed.

      **When I try to execute, I get this error message:**

      --------------------Configuration: MyNewProject - JDK version 1.6.0_21 <Default> - <Default>--------------------
      java.lang.NoClassDefFoundError: EchoLine
      Caused by: java.lang.ClassNotFoundException: EchoLine
      at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
      Could not find the main class: EchoLine. Program will exit.
      Exception in thread "main"
      Process completed.


      When I set up the new file, and the new class, I confirmed the file path.

      I know most people will ask if I am absolutely certain I put in the code in properly, and yes I did. It was a matter of copying word for word, and punctuation. I did it 100% correctly. About 12 times. I have NO idea what this means, but I would REALLY REALLY appreciate any help on this.

      Please keep in mind, I am slightly clueless, and really need to have any help dumbed down a bit. Lol.

      As a side note, this isn't my first project, and I haven't had this problem before now.

      thanks in advance. =)
        • 1. Re: The system cannot find the path specified - Problems
          843789
          MissPamela wrote:
          While trying to compile one of the practice files, I get this error message:

          --------------------Configuration: MyNewProject - JDK version 1.6.0_21 <Default> - <Default>--------------------
          javac: file not found: src_mynewproject.txt (The system cannot find the path specified)
          What is the name of your java source file?
          What is the name of the class you define in the source file?

          **When I try to execute, I get this error message:**

          --------------------Configuration: MyNewProject - JDK version 1.6.0_21 <Default> - <Default>--------------------
          java.lang.NoClassDefFoundError: EchoLine
          Caused by: java.lang.ClassNotFoundException: EchoLine
          at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
          at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
          Could not find the main class: EchoLine. Program will exit.
          Exception in thread "main"
          Is the name of the class you are trying to launch "EchoLine"?
          Is the EchoLine.class class file on the classpath?
          • 2. Re: The system cannot find the path specified - Problems
            843789
            The name of the java source file is mynewproject

            The name of the class is EchoLine

            And here is the class file when I click properties on MyNewProject:
            C:\Program Files\Xinox Software\JCreatorV3\MyProjects\MyNewProject;C:\Program Files\Java\jdk1.6.0_21\jre\lib\rt.jar;C:\Program Files\Java\jdk1.6.0_21\lib\dt.jar;C:\Program Files\Java\jdk1.6.0_21\lib\tools.jar;C:\Program Files\Java\jdk1.6.0_21\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.6.0_21\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.6.0_21\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.6.0_21\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.6.0_21\jre\lib\ext\sunpkcs11.jar

            Is this what you needed? I'm sorry if its not, please be patient with me! =)

            thank you so much!
            • 3. Re: The system cannot find the path specified - Problems
              843789
              MissPamela wrote:
              --------------------Configuration: MyNewProject - JDK version 1.6.0_21 <Default> - <Default>--------------------
              javac: file not found: src_mynewproject.txt (The system cannot find the path specified)

              Process completed.
              Check if you have saved your source file with .java extension. Also, your source file should be named with your class name.
              • 4. Re: The system cannot find the path specified - Problems
                843789
                I just checked, and it is.

                I feel I should point out as well, that I just used the explore option to track the files on my computer, and they are not showing up. I followed the entire path, and it is not in there. Not that it shows. It shows what I worked on the other night, but none of this project. I'm completely confused at this point.
                • 5. Re: The system cannot find the path specified - Problems
                  843789
                  So I wanted to clarify what I've done a bit more since I decided to redownload the dummies programs for the program and try again.

                  I will try to list my steps in order of what I did and see if I've gone wrong somewhere along the line.

                  I downloaded my project files from here: http://ca.dummies.com/store/product/Beginning-Programming-with-Java-For-Dummies-2nd-Edition.productCd-0764588745,navId-322469,descCd-DOWNLOAD.html

                  I unzipped them this time here: C:\Program Files\Java\jdk1.6.0_21\MyProjects\

                  I opened JCreator 3.5 and starting fresh, with all previous projects deleted and clicked on "Open Workspace". I chose "MyWorkspace.jcw". Right clicked MyWorkspace and chose "Add new Project" and then chose "Empty Project". As per the books instruction for the first project, I named it "MyFirstProject". My file path was: C:\Program Files\Java\jdk1.6.0_21\MyProjects\MyFirstProject. Which is where I upzipped the files. I added it to current workspace and clicked finish.

                  I then added a new class. As per the books instructions, I right clicked "MyFirstProject" and selected Add New Class. For the name, I used MyFirstJavaClass, which is what the book told me to do. My locations are the exact same as above. and I clicked on Generate new Method, as it told me to. Which it doesn't in the next few lessons, so I know this has nothing to do with it. For that and a few other reasons. Lol.

                  I clicked on Finish.

                  All I had to do was replace a single line of code. Not type it all in this time.

                  Here is what shows up on the screen:

                  class MyFirstJavaClass {
                       
                       /**
                       * Method main
                       *
                       *
                       * @param args
                       *
                       */
                       public static void main(String[] args) {
                            // TODO: Add your code here
                       }     
                  }


                  I need to change the : // TODO: Add your code here

                  with the line:

                  System.out.println.("Chocolate, royalties, sleep");

                  When I do this, and compile project, I get this:

                  --------------------Configuration: MyFirstProject - JDK version 1.6.0_21 <Default> - <Default>--------------------
                  javac: file not found: src_myfirstproject.txt (The system cannot find the path specified)

                  Process completed.


                  AGAIN! But it worked a few days ago.

                  And when I execute, I get this:

                  --------------------Configuration: MyFirstProject - JDK version 1.6.0_21 <Default> - <Default>--------------------
                  java.lang.NoClassDefFoundError: MyFirstJavaClass
                  Caused by: java.lang.ClassNotFoundException: MyFirstJavaClass
                  at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
                  at java.security.AccessController.doPrivileged(Native Method)
                  at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
                  at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
                  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
                  at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
                  Could not find the main class: MyFirstJavaClass. Program will exit.
                  Exception in thread "main"
                  Process completed.


                  I really hope the extra info helps someone help me!

                  thank you!

                  Edited by: MissPamela on Jul 19, 2010 3:23 PM
                  • 6. Re: The system cannot find the path specified - Problems
                    843789
                    After a bit more searching, and 24 hours of not focusing on anything else basically, I found out that Windows likes having my files in My Documents folder rather than in any other file. Once moved, I was able to test my codes and all worked! Thank you to everyone for your help! =)
                    • 7. Re: The system cannot find the path specified - Problems
                      843789
                      Hello MissPamela,

                      I am having the same problem you had. Can you please be a bit more specific on what files you moved to the MyDocuments folder? Did you just move the entire contents of MyProjects there? Or was it more involved that this?

                      Warm regards,
                      JeffS.
                      • 8. Re: The system cannot find the path specified - Problems
                        843789
                        To answer my own question, I moved the MyProjects folder from within the JCreatorV3LE folder to MyDocuments folder and I could then compile and run the program. Very strange but it worked.

                        JeffS
                        • 9. Re: The system cannot find the path specified - Problems
                          843789
                          This is not strange. This has to do with "user rights and previlages under windows OS. some users like the ones referenced above, might be working under a "limited user account" in windows OS where there may not be administrative previlages to write to the programfiles folder (the default folder) where jcreator files are stored. So, in order to work around this error, either install the jcreator folder in the my documents folder (or on the desktop folder) or work using an administrator account. Hope this helps.

                          The linited user accounts sometimes preclude programs to write in a system folder such as program files.
                          • 10. Re: The system cannot find the path specified - Problems
                            PhHein
                            This thread has now been answered three times, that should be enough. Locking.