Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: Compiling error

  1. #1
    Junior Member
    Join Date
    Oct 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Compiling error

    Hi everyone!

    I'm new to Java and am having problems compiling my first program. I would appreciate any help/pointers as to what I'm doing wrong. Whenever I compile my program I get the following:

    java_compile_error.JPG

    The path to my JRE is : c:\Progarm Files\java

    This is where I also stored my first program titled "MyProgram.java"

    But when I compile the porgram it ciomes up with the error message as shown above.

    I'm running Windows 7 64-bit with JRE7.

    Thanks for any help/assistance.



  2. #2
    Super Moderator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,097
    Thanks
    169
    Thanked 779 Times in 725 Posts
    Blog Entries
    5

    Default Re: Compiling error

    You need to add javac to the Path. See the following for an explanation:
    PATH and CLASSPATH (The Java™ Tutorials > Essential Classes > The Platform Environment)
    As the article describes, adding it to the path is System dependent - there are tons of explanations on how to do so if you search google for something like "path java windows", perhaps including your windows version.

  3. #3
    Junior Member
    Join Date
    Oct 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Compiling error

    Hi copeg.

    Thanks for your reply. I'll check it out and let you know how I get on.

    Thanx.

  4. #4
    Junior Member
    Join Date
    Oct 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Compiling error

    Hi Copeg.

    I went to "Control panel>System and Security>System" then chose "Advanced System Settings", clicked on the "Environment Variables" and updated the CLASSPATH(See picture):

    Classpath_addition.JPG

    Yet when I try to compile MyProgram.java I still get the same error, as per my first posting. Any ideas as to what I might be missing?

    TIA,
    Brian :-)

  5. #5
    Member
    Join Date
    Sep 2011
    Posts
    40
    My Mood
    Inspired
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default Re: Compiling error

    Try this code in your compiler, C:\Program Files\Java\javac.exe

    Also, if you installed java in the Program Files (x86) folder, use this

    C:\Program Files (x86)\Java\javac.exe

    Another thing, sounds like you don't have JDK, you will need this, if you do try this.

    C:\Program Files (x86)\Java\jdk1.7.0\bin\javac.exe
    or
    C:\Program Files\Java\jdk1.7.0\bin\javac.exe

    Your javac shouldn't be in just the "java" folder, it should be in the bin folder marked by your version.
    Last edited by tyb97; October 11th, 2011 at 08:42 AM. Reason: Saw you had Windows 7 64bit

  6. #6
    Junior Member
    Join Date
    Oct 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Compiling error

    Hi guys!

    Just an update on how i got on with my compiling problem.

    I finally had the chance to sit down and figure it out, now everything is working perfectly.

    I want to thank you all so much for your help. It's appreciated!

    Thanx

Similar Threads

  1. Compiling error
    By tangara in forum Java IDEs
    Replies: 3
    Last Post: September 4th, 2011, 03:00 AM
  2. Compiling Error?
    By Arkeshen in forum Java Theory & Questions
    Replies: 2
    Last Post: June 22nd, 2011, 04:31 AM
  3. compiling from a txt file
    By gib65 in forum Java Theory & Questions
    Replies: 4
    Last Post: April 6th, 2011, 11:01 AM
  4. Help with Compiling
    By w.spidey in forum Object Oriented Programming
    Replies: 10
    Last Post: September 9th, 2010, 01:48 PM
  5. Strange Compiling Error
    By crism85 in forum What's Wrong With My Code?
    Replies: 5
    Last Post: October 13th, 2009, 12:59 AM