Results 1 to 5 of 5
  1. #1
    Julian is offline Member
    Join Date
    May 2011
    Posts
    8
    Rep Power
    0

    Angry What the heck??? Need urgent help!

    Okay so whenever I try to compile something, it works normal, and if theres no problems, it will say something about System.out.printIn(); method...heres my example i forgot the ";" after something and it said one error, then once i fixed it it came with a bunch of crap...Im using 1.6 on Linux...heres my command line trying to compile it:


    julian@ubuntu:~/Desktop/Java$ javac SetPoints.java
    SetPoints.java:13: ';' expected
    location.y=6
    ^
    1 error






    Then i fixed it by putting the ";" after "location.y=6"







    julian@ubuntu:~/Desktop/Java$ javac SetPoints.java
    SetPoints.java:7: cannot find symbol
    symbol : method printIn(java.lang.String)
    location: class java.io.PrintStream
    System.out.printIn("Starting location:");
    ^
    SetPoints.java:8: cannot find symbol
    symbol : variable location
    location: class SetPoints
    System.out.printIn("X equals " + location.x);
    ^
    SetPoints.java:8: cannot find symbol
    symbol : method printIn(java.lang.String)
    location: class java.io.PrintStream
    System.out.printIn("X equals " + location.x);
    ^
    SetPoints.java:9: cannot find symbol
    symbol : variable location
    location: class SetPoints
    System.out.printIn("Y equals " + location.y);
    ^
    SetPoints.java:9: cannot find symbol
    symbol : method printIn(java.lang.String)
    location: class java.io.PrintStream
    System.out.printIn("Y equals " + location.y);
    ^
    SetPoints.java:11: cannot find symbol
    symbol : method printIn(java.lang.String)
    location: class java.io.PrintStream
    System.out.printIn("\nMoving to (7,6)");
    ^
    SetPoints.java:12: cannot find symbol
    symbol : variable location
    location: class SetPoints
    location.x=7;
    ^
    SetPoints.java:13: cannot find symbol
    symbol : variable location
    location: class SetPoints
    location.y=6;
    ^
    SetPoints.java:15: cannot find symbol
    symbol : method printIn(java.lang.String)
    location: class java.io.PrintStream
    System.out.printIn("\nEnding location:");
    ^
    SetPoints.java:16: cannot find symbol
    symbol : variable location
    location: class SetPoints
    System.out.printIn("X equals " + location.x);
    ^
    SetPoints.java:16: cannot find symbol
    symbol : method printIn(java.lang.String)
    location: class java.io.PrintStream
    System.out.printIn("X equals " + location.x);
    ^
    SetPoints.java:17: cannot find symbol
    symbol : variable location
    location: class SetPoints
    System.out.printIn("Y equals " + location.y);
    ^
    SetPoints.java:17: cannot find symbol
    symbol : method printIn(java.lang.String)
    location: class java.io.PrintStream
    System.out.printIn("Y equals " + location.y);
    ^
    13 errors
    julian@ubuntu:~/Desktop/Java$ java SetPoints
    Exception in thread "main" java.lang.NoClassDefFoundError: SetPoints
    Caused by: java.lang.ClassNotFoundException: SetPoints
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 21)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 66)
    Could not find the main class: SetPoints. Program will exit.
    julian@ubuntu:~/Desktop/Java$ clear

    julian@ubuntu:~/Desktop/Java$ javac SetPoints.java
    SetPoints.java:7: cannot find symbol
    symbol : method printIn(java.lang.String)
    location: class java.io.PrintStream
    System.out.printIn("Starting location:");
    ^
    SetPoints.java:8: cannot find symbol
    symbol : variable location
    location: class SetPoints
    System.out.printIn("X equals " + location.x);
    ^
    SetPoints.java:8: cannot find symbol
    symbol : method printIn(java.lang.String)
    location: class java.io.PrintStream
    System.out.printIn("X equals " + location.x);
    ^
    SetPoints.java:9: cannot find symbol
    symbol : variable location
    location: class SetPoints
    System.out.printIn("Y equals " + location.y);
    ^
    SetPoints.java:9: cannot find symbol
    symbol : method printIn(java.lang.String)
    location: class java.io.PrintStream
    System.out.printIn("Y equals " + location.y);
    ^
    SetPoints.java:11: cannot find symbol
    symbol : method printIn(java.lang.String)
    location: class java.io.PrintStream
    System.out.printIn("\nMoving to (7,6)");
    ^
    SetPoints.java:12: cannot find symbol
    symbol : variable location
    location: class SetPoints
    location.x=7;
    ^
    SetPoints.java:13: cannot find symbol
    symbol : variable location
    location: class SetPoints
    location.y=6;
    ^
    SetPoints.java:15: cannot find symbol
    symbol : method printIn(java.lang.String)
    location: class java.io.PrintStream
    System.out.printIn("\nEnding location:");
    ^
    SetPoints.java:16: cannot find symbol
    symbol : variable location
    location: class SetPoints
    System.out.printIn("X equals " + location.x);
    ^
    SetPoints.java:16: cannot find symbol
    symbol : method printIn(java.lang.String)
    location: class java.io.PrintStream
    System.out.printIn("X equals " + location.x);
    ^
    SetPoints.java:17: cannot find symbol
    symbol : variable location
    location: class SetPoints
    System.out.printIn("Y equals " + location.y);
    ^
    SetPoints.java:17: cannot find symbol
    symbol : method printIn(java.lang.String)
    location: class java.io.PrintStream
    System.out.printIn("Y equals " + location.y);
    ^
    13 errors

    Heres my script:
    import java.awt.Point;

    class SetPoints {

    public static void main(String arguments[]) {

    System.out.printIn("Starting location:");
    System.out.printIn("X equals " + location.x);
    System.out.printIn("Y equals " + location.y);

    System.out.printIn("\nMoving to (7,6)");
    location.x=7;
    location.y=6;

    System.out.printIn("\nEnding location:");
    System.out.printIn("X equals " + location.x);
    System.out.printIn("Y equals " + location.y);
    }
    }
    Last edited by Julian; 05-07-2011 at 02:57 PM. Reason: im Julian, the writer and i accidently put code to find my Java folder

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    It's telling you (many times) that it can't find the location variable, that you've never declared it, and it's right. Solution: declare and initialize the variable.

    Also, please avoid using "urgent" in your posts as it has the opposite effect that you've intended -- usually less folks will want to help you because it's not really our urgency, and no one wants to feel pushed, least of all volunteers who help for free.

    Luck.

  3. #3
    Julian is offline Member
    Join Date
    May 2011
    Posts
    8
    Rep Power
    0

    Default

    yeah sorry im new to this site (first time today) and im pretty new to java...how would you declare and initialize the variable (sorry for so many questions)

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

    Default

    Also,
    Java Code:
    System.out.printIn =/= System.out.println

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by Julian View Post
    yeah sorry im new to this site (first time today) and im pretty new to java...how would you declare and initialize the variable (sorry for so many questions)
    You give the variable's type, it's name and then a value. For instance here are three variable declarations with initialized values:

    Java Code:
    int myVar = 3;
    Point aPointVar = new Point(0, 0);
    Dimension mySize = new Dimension(400, 200);
    //... etc ...

Similar Threads

  1. Urgent HELP!
    By Mp4Player in forum New To Java
    Replies: 2
    Last Post: 01-04-2011, 09:34 PM
  2. Urgent
    By agentkiran007 in forum Advanced Java
    Replies: 23
    Last Post: 08-08-2010, 04:59 PM
  3. [URGENT]SHA Encryption System...need urgent helps
    By java_idiot in forum New To Java
    Replies: 6
    Last Post: 05-02-2010, 11:04 AM
  4. Urgent
    By ozgun in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 04-23-2010, 04:39 AM
  5. Urgent Help!!
    By Winniee in forum New To Java
    Replies: 5
    Last Post: 02-17-2009, 04:32 AM

Tags for this Thread

Posting Permissions

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