[Solved]At my wit's end to correct the error messages in Eclipse [message #1770978] |
Sun, 20 August 2017 11:37 |
RajibKumar Bandopadhyay Messages: 58 Registered: July 2014 |
Member |
|
|
Five Files in compressed format attached as New_CalculatorModel.tar.gz.
The codes were taken from `Learn Java in a Weekend` by `Joseph Russell`.
All of these files show errors in Eclipse and don't appear to compile in Eclipse, but all except one compile at the terminal with Javac filename.java
That one, CalculatorHelperTest.java , shows the following error messages and doesn't compile, even from the terminal.
javac CalculatorHelperTest.java
CalculatorHelperTest.java:11: cannot find symbol
symbol : method setOperand1(double)
location: class CalculatorHelper
calcHelper.setOperand1(a);
^
CalculatorHelperTest.java:12: cannot find symbol
symbol : method setOperand2(double)
location: class CalculatorHelper
calcHelper.setOperand2(b);
^
CalculatorHelperTest.java:13: add() has private access in CalculatorHelper
System.out.println(a + " + " + b + " = " + calcHelper.add());
^
CalculatorHelperTest.java:14: subtract() has private access in CalculatorHelper
System.out.println(a + " - " + b + " = " + calcHelper.subtract());
^
CalculatorHelperTest.java:15: multiply() has private access in CalculatorHelper
System.out.println(a + " * " + b + " = " + calcHelper.multiply());
^
CalculatorHelperTest.java:16: divide() has private access in CalculatorHelper
System.out.println(a + " / " + b + " = " + calcHelper.divide());
^
6 errors
My master, Dr. Merks, please advise.
[Updated on: Wed, 23 August 2017 11:51] Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: At my wit's end to correct the error messages in Eclipse [message #1771230 is a reply to message #1771229] |
Wed, 23 August 2017 06:34 |
RajibKumar Bandopadhyay Messages: 58 Registered: July 2014 |
Member |
|
|
Dr. Merks, I was editing when you replied. So could you please go back?
Quote:In the IDE you can bring up the context menu within the editor on the Java file in the outline and invoke "Run As -> Java Application".
Okay! This part was actually followed since way back, the first time I was told!
Quote:That will of course only work on classes has have a main method. I don't know of any way to run multiple Java Applications at once.
Okay! This part is understood!
Then why are those error messages, java.lang.NoSuchMethod occurring and being shown when I invoke 'Run'?
[Updated on: Wed, 23 August 2017 06:55] Report message to a moderator
|
|
|
|
[Solved]Re: At my wit's end to correct the error messages in Eclipse [message #1771247 is a reply to message #1771235] |
Wed, 23 August 2017 10:29 |
RajibKumar Bandopadhyay Messages: 58 Registered: July 2014 |
Member |
|
|
Yes, my query is: Why? I have followed the book! I have carefully removed and replaced all the doubtful punctuation marks. Okay, I will check thoroughly once more!
But then why is OpenJDK allowing the files to run?
[Later]
This part gave me the clue. The console registered:
ConsoleThe project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project CalculatorModel Unknown Java Problem I had built the CalculatorModel folder manually within the Eclipse workspace folder, and did not place the source codes within the src folder, and so the .classpath file was not built.
Built an src folder and moved all the sources to that folder. Studied and copied a .classpath file from another project in the CalculatorModel folder. And the problem was resolved!
[Updated on: Sat, 26 August 2017 07:44] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.09918 seconds