Uncompilable source code - Erroneous sym type:

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");
        }
    }
}

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


This is a common issue which I get while working. What I do is clean and build the project. It solves the problem.

Right Click on the project name >> Clean and build