Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

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 2 of 2
  1. #1
    Junior Member
    Join Date
    Jan 2025
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Learning Java errors

    Ok, what am I doing wrong. Again, am trying to learn this thing called Java but, at my age I think is to late. Anyway, I already follow all the steps necessary to download, install, change the path, etc. Every time I run Javac I get this error:

    C:\Users\Alfredo\OneDrive\Desktop\Java-practice> javac HellowWorld.java
    error: file not found: HellowWorld.java
    Usage: javac <options> <source files>
    use --help for a list of possible options

    Without the .java extension, I get:
    C:\Users\Alfredo\OneDrive\Desktop\Java-practice>Javac HelloWorld
    Error: Could not find or load main class HelloWorld
    Caused by: java.lang.ClassNotFoundException: HelloWorld

    The file is in the folder
    Directory of C:\Users\Alfredo\OneDrive\Desktop\Java-practice

    02/11/2025 08:50 AM <DIR> .
    02/10/2025 02:52 PM <DIR> ..
    02/11/2025 09:07 AM 157 HelloWorld.java.txt
    1 File(s) 157 bytes
    2 Dir(s) 100,030,808,064 bytes free
    Please help and remember am almost 65 years old
    ...

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,173
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Learning Java errors

    Directory of C:\Users\Alfredo\OneDrive\Desktop\Java-practice

    02/11/2025 08:50 AM <DIR> .
    02/10/2025 02:52 PM <DIR> ..
    02/11/2025 09:07 AM 157 HelloWorld.java.txt
    Notice that the extension shown in the above is .txt. Rename the file to HellowWorld.java removing the .txt extension.

    The Windows' FileExplorer program HIDES extensions for many files. I recommend that you Go into the settings for FileExplorer and change them so that all files' extensions are shown.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. New, currently learning java.
    By ChronoKross in forum Member Introductions
    Replies: 3
    Last Post: August 13th, 2021, 12:54 PM
  2. I'm just learning Java
    By michael.duffy31 in forum Object Oriented Programming
    Replies: 2
    Last Post: June 5th, 2013, 10:27 AM
  3. Learning java!
    By gagaenter in forum What's Wrong With My Code?
    Replies: 1
    Last Post: May 29th, 2013, 06:21 AM
  4. Need some help, learning java!
    By thisguyrighthere in forum Object Oriented Programming
    Replies: 5
    Last Post: June 10th, 2012, 09:41 PM
  5. Hello. Just Learning Java For Fun..
    By derekeverett in forum Member Introductions
    Replies: 1
    Last Post: March 18th, 2010, 04:24 PM