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: need help (dunno if im posting in right thread or not)

  1. #1
    Junior Member
    Join Date
    Apr 2021
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default need help (dunno if im posting in right thread or not)

    HI all, Started learning Java and im using the Text Editor that was already installed on my pc, (Linux Mint) and i am trying to run my code through the Terminal.
    Ive saved my program in a .java file and created a folder called 'programming' for it. the folder is inside the 'Documents" folder. so home/documents/programming.

    the issue comes when i try to compile it with 'javac LearningJava.java' and it shows

    'error: file not found: LearningJava,java
    usage: javac <options> <source files>'

    I then typed in 'pwd' in the terminal and it showed '(my username)/home' so i tried moving the file to 'home' and everything worked as i imagine it should. but i would like to be able to save it to my programming folder and run it from there if possible. (I am new to all this stuff so sorry if im not wording it correctly)

    any suggestions would be great. thanks - sam

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

    Default Re: need help (dunno if im posting in right thread or not)

    When you entered the javac command were you in the same folder containing the LearningJava.java file?
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Apr 2021
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: need help (dunno if im posting in right thread or not)

    I dont think i quite get what you mean there, are you asking if i had the file window open? if so, then no i didnt.

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: need help (dunno if im posting in right thread or not)

    What folder were you in when you entered the javac command?
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member
    Join Date
    Apr 2021
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: need help (dunno if im posting in right thread or not)

    just checked, i was in the /home folder.

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: need help (dunno if im posting in right thread or not)

    You need to be in the same folder as the LearningJava.java file.
    Or use an javac program commandline option to tell javac where the source file is located.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Why is my posting prevented?
    By BassmanCoder in forum The Cafe
    Replies: 2
    Last Post: July 5th, 2020, 05:50 AM
  2. Cross-posting
    By catisch in forum Totally Off Topic
    Replies: 2
    Last Post: October 18th, 2013, 08:25 AM
  3. dunno how to test this code so i dont know if it works help please
    By jonathanfox in forum What's Wrong With My Code?
    Replies: 5
    Last Post: July 24th, 2012, 04:43 AM
  4. I dunno What I'm Doing :(
    By x3rubiachica3x in forum What's Wrong With My Code?
    Replies: 1
    Last Post: September 28th, 2010, 09:36 PM