Javac Unrecognized


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 8 of 8

Thread: Javac Unrecognized

  1. #1
    Join Date
    Jun 2004
    Posts
    4

    Unhappy Javac Unrecognized

    Sorry Folks, Im sure you have had many posts about this but despite all my efforts I still cannot get javac working.

    Ive taken a screenie of the error I get in Dos


    I have also updated my Path Variables to: %SYSTEMROOT%\system32;%SYSTEMROOT%;%SYSTEMROOT%\COMMAND;%SYSTEMROOT%\system32\WBEM;C:\j2sd k1.4.2_04\bin

    I know the location is right.

    Also, I am useing Windows XP.

    Any Ideas? Thanks in advance guys

    Tiepo

  2. #2
    Join Date
    May 2004
    Posts
    219
    ENV var changes in XP don't require a reboot, but you can't use the same instance of command/cmd.exe. So if you are using the same window that you used prior to the change, that would be your problem.

    PS: Use cmd instead of command, it's much faster.

  3. #3
    Join Date
    Jun 2004
    Posts
    4

    Talking OMG IT WORKED!?!?

    *BLINK* Omg it worked in cmd

    Why wouldn't it work in command???

    Anyway THANKS ALOT

    I hope it continues working

    EDIT: Nope now I have another error



    This is my code,

    /**
    * The HelloWorldApp class implements an application that
    * simply displays "Hello World!" to the standard output.
    */
    class HelloWorldApp {
    public static void main(String[] args) {
    System.out.println("Hello World!"); //Display the string.
    }
    }

    DOes anyone know what the problem might be?

  4. #4
    Join Date
    May 2004
    Posts
    219
    You are trying to "run" your source code (the .java), when you should be running the compiled code (the .class).

  5. #5
    Join Date
    Jun 2004
    Posts
    4

    Talking

    Oops, silly me

    I tried running the .class but now I get this.

    Could anyone point out what Im probly doing wrong this time?
    Thanks Tiepo

  6. #6
    Join Date
    May 2004
    Posts
    219
    Er, sorry, I forgot to mention that the .class is assumed
    Code:
    java HelloWorldApp

  7. #7
    Join Date
    Jun 2004
    Posts
    4

    Talking Thanks! :D

    Ok thnk
    Thanky very much I got it working

  8. #8
    Join Date
    Feb 2004
    Posts
    808
    Originally posted by Drain
    Er, sorry, I forgot to mention that the .class is assumed
    Code:
    java HelloWorldApp
    more accurately; it cannot be expressed, because . is assumed to be a package directive, so running:

    java ABC.class

    will attempt to run the class called "class" inside the package ABC.

    you will, of course, then get a NoClassDefFoundError
    The 6th edict:
    "A thing of reference thing can hold either a null thing or a thing to any thing whose thing is assignment compatible with the thing of the thing" - ArchAngel, www.dictionary.com et al.
    JAR tutorial GridBag tutorial Inherited Shapes Inheritance? String.split(); FTP?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center