Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uncompilable source code - Erroneous sym type:

Tags:

java

There was error occurred in Line 14.

Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous sym type:

Hard to find solution.

package example;

public class Num
{
    public static void main(String [] args) 
    {
    String s = "42";
        try 
        {
            s = s.concat(".5"); 
            double d = Double.parseDouble(s);
            s = Double.toString(d);
            int x = (int) Math.ceil(Double.valueOf(s).doubleValue()); //Line 14
            System.out.println(x);
        }
        catch (NumberFormatException e) 
        {
            System.out.println("Wrong Number");
        }
    }
}
like image 310
Dis_Pro Avatar asked Jan 31 '16 12:01

Dis_Pro


1 Answers

The code you provided runs fine on my computer.

I'm guessing you are using Netbeans and may be affected by a bug. Try this:

Open the project properties, select the Build-Compiling, uncheck "Compile on save" and rerun the application. This will make sure all your source code becomes recompiled before running it.

Link: https://forums.netbeans.org/topic43241.html

like image 199
sinclair Avatar answered Oct 10 '22 09:10

sinclair