4 Replies - 419 Views - Last Post: 31 August 2012 - 09:02 AM Rate Topic: -----

#1 jaffinito34  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 31-August 12

Exception in thread "main" java.lang.Error: Unresolved compila

Posted 31 August 2012 - 06:49 AM

I need to learn java for my software engineering class (All I know is python) and I'm running into problems right away.



Exception in thread "main" java.lang.Error: Unresolved compilation problem:

at PointChecker.main(pointChecker.java:6)




Here's my code:

import java.util.Scanner;


public class PointChecker {

	public static void main(String[] args) {
		boolean notdone = true;
		while (notdone) {
			System.out.println("Please enter 3 points");
			Scanner scan = new Scanner(System.in);
			int x1 = scan.nextInt();
			int y1 = scan.nextInt();
			int x2 = scan.nextInt();
			int y2 = scan.nextInt();
			int x3 = scan.nextInt();
			int y3 = scan.nextInt();
		} // while
	} // main

}





Please help thanks

Is This A Good Question/Topic? 0
  • +

Replies To: Exception in thread "main" java.lang.Error: Unresolved compila

#2 GregBrannon  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2205
  • View blog
  • Posts: 5,239
  • Joined: 10-September 10

Re: Exception in thread "main" java.lang.Error: Unresolved compila

Posted 31 August 2012 - 06:55 AM

I don't see the problem, or any problem for that matter. Any more details available?

A pointer: You probably already know you have an infinite while loop - I assume it's a project under construction - but don't do things inside the loop that only need to be done once, like creating the Scanner object.
Was This Post Helpful? 0
  • +
  • -

#3 jaffinito34  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 31-August 12

Re: Exception in thread "main" java.lang.Error: Unresolved compila

Posted 31 August 2012 - 07:04 AM

For this project, I'm trying to get 3 points
- then exit when the first two points are equal

In part 1, the program will
- print which point 1 or 2 is closer to point 3
- consider the first two points as the upper left and lower right corner
-print the closest corner
In part 2, modify the program to
- ask for one more po9int after the first part has completed
- determine whether or not the box created by points 1 and 2 overlap..
- print out whether the first box

is fully contained in the second
partially overlaps with the second
fully contains the second
or has no overlap
Was This Post Helpful? 0
  • +
  • -

#4 GregBrannon  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2205
  • View blog
  • Posts: 5,239
  • Joined: 10-September 10

Re: Exception in thread "main" java.lang.Error: Unresolved compila

Posted 31 August 2012 - 07:59 AM

So, lots of work to do, and it's good that you're taking small steps, testing as you go. Find the unresolved compilation problem yet?

You might also consider improving the user prompts so the user knows that s/he is entering X1, Y1, X2, Y2, etc., what to do to exit (Is that the assignment, exit when the first two points are equal? That's awkward.), maybe explain what the program does. As the programmer, you know all this, but the person running the program hasn't a clue.
Was This Post Helpful? 0
  • +
  • -

#5 jon.kiparsky  Icon User is offline

  • Pancakes!
  • member icon


Reputation: 8028
  • View blog
  • Posts: 13,740
  • Joined: 19-March 11

Re: Exception in thread "main" java.lang.Error: Unresolved compila

Posted 31 August 2012 - 09:02 AM

If you're still having trouble with that error, we'd need a bit more information to resolve it.
Here's a few questions - I'm just fishing here.

- What sort of environment are you using to write and compile your code?
- Is there any further information in the error output?
- Can you build a simple hello world, or does that error out as well?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1