Results 1 to 10 of 10
Like Tree1Likes
  • 1 Post By JosAH

Thread: I am brand new to Java and am having trouble. Help!

  1. #1
    injustpotato is offline Member
    Join Date
    Mar 2012
    Posts
    3
    Rep Power
    0

    Default I am brand new to Java and am having trouble. Help!

    So I am following this guide here:

    "Hello World!" for Microsoft Windows (The Java™ Tutorials > Getting Started > The "Hello World!" Application)

    I am using Notepad++ to edit, and I saved it as HelloWorldApp.java. When I tried to compile it in the command prompt, it displayed that 'javac' could not be found. I updated the PATH to where the JDK bin is using this as a guide:

    JDK Installation for Microsoft Windows

    Now when I type >javac HelloWorldApp.java nothing happens.

    I have never used Java this way, so I have no idea what to do. Help!

  2. #2
    subzero1012 is offline Member
    Join Date
    Feb 2012
    Location
    Phoenix, AZ
    Posts
    26
    Rep Power
    0

    Default Re: I am brand new to Java and am having trouble. Help!

    It may mean that your code has compiled finely and that a .class file has been created. Check the directory where your HelloWorldApp.java file is located and see if a HelloWorldApp.class file has been created.

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,453
    Blog Entries
    7
    Rep Power
    20

    Default Re: I am brand new to Java and am having trouble. Help!

    Type "dir" and check if the compiler has produced a "HelloWorldApp.class" file. If so, you can run it with the java.exe virtual machine: "java HelloWorldApp".

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  4. #4
    java4amanda is offline Member
    Join Date
    Jan 2012
    Posts
    55
    Rep Power
    0

    Default Re: I am brand new to Java and am having trouble. Help!

    simple dear

    install java.

    go to java >> jdk1.5 or your installed version folder >> bin directory

    copy the path of the bin director.

    right click on my computer >> select properties >> click advanced tab >> press environmental variables button >> under system variable check if any variable named path is defined or not. if not click new button, enter variable name as path and paste the url of ur jdk bin path under variable value field. now press ok buttons followed by apply and ok button. restart ur system and go to run type cmd and then in the command prompt type javac to check

  5. #5
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,453
    Blog Entries
    7
    Rep Power
    20

    Default Re: I am brand new to Java and am having trouble. Help!

    Quote Originally Posted by java4amanda View Post
    simple dear
    That's not it because the OP wrote:

    Quote Originally Posted by OP
    Now when I type >javac HelloWorldApp.java nothing happens.
    It implies that javac.exe is installed and the command line interpreter was able to find it.

    kind regards,

    Jos
    sunde887 likes this.
    cenosillicaphobia: the fear for an empty beer glass

  6. #6
    injustpotato is offline Member
    Join Date
    Mar 2012
    Posts
    3
    Rep Power
    0

    Default Re: I am brand new to Java and am having trouble. Help!

    Does it make a difference if my jdk is installed to Program Files x86 instead of Program Files?

    Also, it's giving me loads of errors.

    Edit: It compiles, but it doesn't run.
    Last edited by injustpotato; 03-20-2012 at 09:43 PM.

  7. #7
    DarrylBurke's Avatar
    DarrylBurke is online now Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,202
    Rep Power
    19

    Default Re: I am brand new to Java and am having trouble. Help!

    Quote Originally Posted by injustpotato View Post
    Also, it's giving me loads of errors.

    Edit: It compiles, but it doesn't run.
    When seeking help with an error, post the entire error text/stack trace. Just saying 'loads of errors' doesn't help. Just as 'doesn't run' is equally uninformative.

    The details are important if you want to get help on a programming forum.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  8. #8
    injustpotato is offline Member
    Join Date
    Mar 2012
    Posts
    3
    Rep Power
    0

    Default Re: I am brand new to Java and am having trouble. Help!

    Quote Originally Posted by DarrylBurke View Post
    When seeking help with an error, post the entire error text/stack trace. Just saying 'loads of errors' doesn't help. Just as 'doesn't run' is equally uninformative.

    The details are important if you want to get help on a programming forum.

    db
    I get this:
    Attached Thumbnails Attached Thumbnails I am brand new to Java and am having trouble. Help!-nsaw7.png  

  9. #9
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default Re: I am brand new to Java and am having trouble. Help!

    I love that you are using a simple text editor. What does your code look like? When you typed
    Java Code:
    javac HelloWorld.java
    you got the above error?

  10. #10
    DarrylBurke's Avatar
    DarrylBurke is online now Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,202
    Rep Power
    19

    Default Re: I am brand new to Java and am having trouble. Help!

    Your JRE is an older version than your JDK. Update the JRE.

    db
    Last edited by DarrylBurke; 03-21-2012 at 04:30 AM.
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Help please?// Brand new here.
    By GoodThing007 in forum New To Java
    Replies: 10
    Last Post: 12-04-2011, 09:08 PM
  2. Brand New To Java, what does it actually do?
    By Geslincm in forum New To Java
    Replies: 1
    Last Post: 11-10-2011, 07:14 PM
  3. Brand new to java ... window is closing
    By drw4d in forum New To Java
    Replies: 5
    Last Post: 03-20-2011, 05:48 PM
  4. BRAND new to Java (editor question)
    By hayden06f4i in forum New To Java
    Replies: 2
    Last Post: 10-20-2010, 10:11 PM
  5. Brand New to Java needs directions
    By NatasjaA in forum New To Java
    Replies: 13
    Last Post: 04-07-2008, 04:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •