Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why doesn't this code work in Netbeans 7.0?

 
Michael Kenning
Greenhorn
Posts: 3
Chrome Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I run the following code which I got from Head First Java (it uses Java 5.0, by the way), I get the following error:
run:
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous sym type: Accum.getAccum
at ThreadOne.<init>(TestThreads.java:27)
at TestThreads.main(TestThreads.java:18)
Java Result: 1
BUILD SUCCESSFUL (total time: 2 seconds)

Here is the code:



Can anybody help me with this problem? I have marked the problem lines, by the way.
 
Andrey Kozhanov
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Errors are at lines 64 and 79. They both are , but should be
 
Michael Kenning
Greenhorn
Posts: 3
Chrome Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andrey Kozhanov wrote:Errors are at lines 64 and 79. They both are , but should be


Thanks! That helped a lot! But now I am getting the following error:

run:
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous sym type: Accum.getAccum
at ThreadOne.<init>(TestThreads.java:27)
at TestThreads.main(TestThreads.java:18)
Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)

What does "Erroneous sym type" mean?
 
Rob Spoor
Sheriff
Pie
Posts: 20669
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No idea. After fixing those two catch errors the code compiles just fine on my system (Windows 7, JDK 1.6.0_25). The results are random though, but that makes sense since there is no synchronization on the updating of the counter.
 
agilemanoj kumar
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No exceptions/errors found. I tried on windows xp with jdk 1.6
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic