Results 1 to 16 of 16

Thread: Java Help

  1. #1
    Senior Member
    Join Date
    Feb 2007
    Location
    The dark side of the Moon
    Posts
    408
    Thanks
    139
    Thanked
    12 times in 3 posts

    Java Help

    So....I decided that I should learn Java, just to get one programming language under my belt (hopefully) before I leave college. Great. I went to this site:
    "Hello World!" for Microsoft Windows (The Java™ Tutorials > Getting Started > The "Hello World!" Application)
    and followed the guide. I installed the JDK, and then followed the instructions....
    When it gets to the part where you have to open command prompt, I do it all and then type in 'javac HelloWorldApp.java' and it says "javac is not recognised as an internal or external command....."

    Does anyone have any idea what could be wrong?
    I uninstalled the JDK from my D drive, and put it in the default folder on C just to see if that works but same problem. I rebooted after both installs and the problem still persists...I'm guessing its something simple, but i just can't see it!

  2. #2
    cat /dev/null streetster's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    4,138
    Thanks
    119
    Thanked
    100 times in 82 posts
    • streetster's system
      • Motherboard:
      • Asus P7P55D-E
      • CPU:
      • Intel i5 750 2.67 @ 4.0Ghz
      • Memory:
      • 4GB Corsair XMS DDR3
      • Storage:
      • 2x1TB Drives [RAID0]
      • Graphics card(s):
      • 2xSapphire HD 4870 512MB CrossFireX
      • PSU:
      • Corsair HX520W
      • Case:
      • Coolermaster Black Widow
      • Operating System:
      • Windows 7 x64
      • Monitor(s):
      • DELL U2311
      • Internet:
      • Virgin 50Mb

    Re: Java Help

    you need to have the java 'bin' directory in your path...

    to do this:

    Right-click 'My Computer -> properties -> 'advanced' tab -> Environment Variables -> double-click Path

    and add:

    c:\program files\[path to jdk here]\bin;

    to the end of it.

    (eg mine is: C:\Program Files\Java\jdk1.6.0\bin)

    then open up a new command prompt and it should work

  3. Received thanks from:

    DevilMayCry42 (10-02-2008)

  4. #3
    Senior Member
    Join Date
    Feb 2007
    Location
    The dark side of the Moon
    Posts
    408
    Thanks
    139
    Thanked
    12 times in 3 posts

    Re: Java Help

    I get the the environment variables and I dont see "Path" to double click...

    Oh this is strange, I feel like one of the people here at college that I usually help out - They have no clue aswell!

  5. #4
    cat /dev/null streetster's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    4,138
    Thanks
    119
    Thanked
    100 times in 82 posts
    • streetster's system
      • Motherboard:
      • Asus P7P55D-E
      • CPU:
      • Intel i5 750 2.67 @ 4.0Ghz
      • Memory:
      • 4GB Corsair XMS DDR3
      • Storage:
      • 2x1TB Drives [RAID0]
      • Graphics card(s):
      • 2xSapphire HD 4870 512MB CrossFireX
      • PSU:
      • Corsair HX520W
      • Case:
      • Coolermaster Black Widow
      • Operating System:
      • Windows 7 x64
      • Monitor(s):
      • DELL U2311
      • Internet:
      • Virgin 50Mb

    Re: Java Help


  6. Received thanks from:

    DevilMayCry42 (10-02-2008)

  7. #5
    Senior Member
    Join Date
    Feb 2007
    Location
    The dark side of the Moon
    Posts
    408
    Thanks
    139
    Thanked
    12 times in 3 posts

    Re: Java Help

    Right. I'm gonna uninstall it agian, and put it back onto my D drive (software) and then see what to do from there

    EDIT:

    nevermind, i cant be arsed to move it, I found "path". Thanks a bunch, i'll see if it works now!

  8. #6
    cat /dev/null streetster's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    4,138
    Thanks
    119
    Thanked
    100 times in 82 posts
    • streetster's system
      • Motherboard:
      • Asus P7P55D-E
      • CPU:
      • Intel i5 750 2.67 @ 4.0Ghz
      • Memory:
      • 4GB Corsair XMS DDR3
      • Storage:
      • 2x1TB Drives [RAID0]
      • Graphics card(s):
      • 2xSapphire HD 4870 512MB CrossFireX
      • PSU:
      • Corsair HX520W
      • Case:
      • Coolermaster Black Widow
      • Operating System:
      • Windows 7 x64
      • Monitor(s):
      • DELL U2311
      • Internet:
      • Virgin 50Mb

    Re: Java Help

    do you not have 'Path' in system variables? If not, add a new one

  9. #7
    Senior Member
    Join Date
    Feb 2007
    Location
    The dark side of the Moon
    Posts
    408
    Thanks
    139
    Thanked
    12 times in 3 posts

    Re: Java Help

    Yaaay, thanks streetster, It works....



    now i get

    HelloWorldApp.java:7: cannot find symbol
    symbol : method prongIn<java.lang.String>
    location: class java.io.PrintStream
    System.out.pringIn <"Hello World!:>;//Display the sring.

    1 error


  10. #8
    cat /dev/null streetster's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    4,138
    Thanks
    119
    Thanked
    100 times in 82 posts
    • streetster's system
      • Motherboard:
      • Asus P7P55D-E
      • CPU:
      • Intel i5 750 2.67 @ 4.0Ghz
      • Memory:
      • 4GB Corsair XMS DDR3
      • Storage:
      • 2x1TB Drives [RAID0]
      • Graphics card(s):
      • 2xSapphire HD 4870 512MB CrossFireX
      • PSU:
      • Corsair HX520W
      • Case:
      • Coolermaster Black Widow
      • Operating System:
      • Windows 7 x64
      • Monitor(s):
      • DELL U2311
      • Internet:
      • Virgin 50Mb

    Re: Java Help

    cos its not:

    System.out.pringIn

    its

    System.out.println("hello world");

    (P R I N T L N)

  11. Received thanks from:

    DevilMayCry42 (10-02-2008)

  12. #9
    Senior Member
    Join Date
    Feb 2007
    Location
    The dark side of the Moon
    Posts
    408
    Thanks
    139
    Thanked
    12 times in 3 posts

    Re: Java Help

    It's coz the 'g' is next to the 't'!!!

    Ok, i re-typed it, and now it seems to work. Thanks for all the help Streetster

  13. #10
    cat /dev/null streetster's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    4,138
    Thanks
    119
    Thanked
    100 times in 82 posts
    • streetster's system
      • Motherboard:
      • Asus P7P55D-E
      • CPU:
      • Intel i5 750 2.67 @ 4.0Ghz
      • Memory:
      • 4GB Corsair XMS DDR3
      • Storage:
      • 2x1TB Drives [RAID0]
      • Graphics card(s):
      • 2xSapphire HD 4870 512MB CrossFireX
      • PSU:
      • Corsair HX520W
      • Case:
      • Coolermaster Black Widow
      • Operating System:
      • Windows 7 x64
      • Monitor(s):
      • DELL U2311
      • Internet:
      • Virgin 50Mb

    Re: Java Help

    You're welcome, happy java-ing

  14. #11
    Senior Member
    Join Date
    Feb 2007
    Location
    The dark side of the Moon
    Posts
    408
    Thanks
    139
    Thanked
    12 times in 3 posts

    Re: Java Help


    That site is really confusing...
    I know its a long shot, as most of you probably took CS at uni, but do any of you know of any good begginer sites? I know (pretty much) nothing of programming at all (i stared with VB a few years ago, but stopped after about 2 months and never picked it up again)....

    Any help is appreciated

  15. #12
    cat /dev/null streetster's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    4,138
    Thanks
    119
    Thanked
    100 times in 82 posts
    • streetster's system
      • Motherboard:
      • Asus P7P55D-E
      • CPU:
      • Intel i5 750 2.67 @ 4.0Ghz
      • Memory:
      • 4GB Corsair XMS DDR3
      • Storage:
      • 2x1TB Drives [RAID0]
      • Graphics card(s):
      • 2xSapphire HD 4870 512MB CrossFireX
      • PSU:
      • Corsair HX520W
      • Case:
      • Coolermaster Black Widow
      • Operating System:
      • Windows 7 x64
      • Monitor(s):
      • DELL U2311
      • Internet:
      • Virgin 50Mb

    Re: Java Help

    What problems are you having in particular?

    We had a few java modules at uni, and the rest i just googled to work out how stuff is done

  16. #13
    Senior Member
    Join Date
    Feb 2007
    Location
    The dark side of the Moon
    Posts
    408
    Thanks
    139
    Thanked
    12 times in 3 posts

    Re: Java Help

    This page

    Lesson: A Closer Look at the "Hello World!" Application (The Java™ Tutorials > Getting Started)

    Maybe I'm just tired, but it isn't making much sense....

    I'll look at it again tomorow after school, see if it makes more sense.

    I think it was sometime around here:
    "The keyword class begins the class definition for a class named name, and the code for each class appears between the opening and closing curly braces marked in bold above. Chapter 2 provides an overview of classes in general, and Chapter 4 discusses classes in detail. For now it is enough to know that every application begins with a class definition." That I just went and decided to look again tomorow

    I am going to hit the bed now, as it is quite late out here.
    Please do help, I'll be back tomorow....

  17. #14
    cat /dev/null streetster's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    4,138
    Thanks
    119
    Thanked
    100 times in 82 posts
    • streetster's system
      • Motherboard:
      • Asus P7P55D-E
      • CPU:
      • Intel i5 750 2.67 @ 4.0Ghz
      • Memory:
      • 4GB Corsair XMS DDR3
      • Storage:
      • 2x1TB Drives [RAID0]
      • Graphics card(s):
      • 2xSapphire HD 4870 512MB CrossFireX
      • PSU:
      • Corsair HX520W
      • Case:
      • Coolermaster Black Widow
      • Operating System:
      • Windows 7 x64
      • Monitor(s):
      • DELL U2311
      • Internet:
      • Virgin 50Mb

    Re: Java Help

    A way to think of java classes and methods is that it is a way of modelling something in the real world...

    Classes have attributes which are variables (int/string/array/other even classes) and methods which are a way of 'doing' something to the class...

    In order to 'use' a class, you have to instantiate it, and then you get an object... and a Class just has all the bits of stuff about the thing you want to model.

    methods look like:

    Code:
    public void doSomething(String s) {
    
    System.out.println("string:" + s);
    
    }
    the 'void' means that nothing is being returned... you can pass a method some variable, and perform an action on that variable and then return the modified variable out again..


    hmm i've mostly just waffled..

  18. #15
    Senior Member
    Join Date
    Feb 2007
    Location
    The dark side of the Moon
    Posts
    408
    Thanks
    139
    Thanked
    12 times in 3 posts

    Re: Java Help

    Quote Originally Posted by streetster View Post
    A way to think of java classes and methods is that it is a way of modelling something in the real world...

    Classes have attributes which are variables (int/string/array/other even classes) and methods which are a way of 'doing' something to the class...

    In order to 'use' a class, you have to instantiate it, and then you get an object... and a Class just has all the bits of stuff about the thing you want to model.

    methods look like:

    Code:
    public void doSomething(String s) {
    
    System.out.println("string:" + s);
    
    }
    the 'void' means that nothing is being returned... you can pass a method some variable, and perform an action on that variable and then return the modified variable out again..


    hmm i've mostly just waffled..


    Last edited by DevilMayCry42; 11-02-2008 at 06:20 PM.

  19. #16
    cat /dev/null streetster's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    4,138
    Thanks
    119
    Thanked
    100 times in 82 posts
    • streetster's system
      • Motherboard:
      • Asus P7P55D-E
      • CPU:
      • Intel i5 750 2.67 @ 4.0Ghz
      • Memory:
      • 4GB Corsair XMS DDR3
      • Storage:
      • 2x1TB Drives [RAID0]
      • Graphics card(s):
      • 2xSapphire HD 4870 512MB CrossFireX
      • PSU:
      • Corsair HX520W
      • Case:
      • Coolermaster Black Widow
      • Operating System:
      • Windows 7 x64
      • Monitor(s):
      • DELL U2311
      • Internet:
      • Virgin 50Mb

    Re: Java Help

    just get stuck in, you'll figure it out

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Cannot get Java Working in IE 7.0 (Vista)
    By shuntfield in forum Help! Quick Relief From Tech Headaches
    Replies: 3
    Last Post: 07-11-2007, 10:27 PM
  2. Key Java source code to be opened
    By Steve in forum HEXUS News
    Replies: 0
    Last Post: 27-06-2005, 10:54 AM
  3. Replies: 0
    Last Post: 14-06-2005, 12:02 PM
  4. ATi + Java + BSOD?
    By Kezzer in forum PC Hardware and Components
    Replies: 1
    Last Post: 11-06-2005, 01:26 PM
  5. Java Problems
    By Applecrusher in forum Software
    Replies: 4
    Last Post: 27-04-2004, 01:12 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
  •