following error occurred while executing this line: Class not found: javac1.8

22,754

In Netbeans go to Preferences -> Java -> Ant. If your on an older version of Netbeans, the Ant tab may be under Preferences -> Miscellaneous -> Ant. At the very top it should have a label saying something like "(Apache Ant(™) version 1.93 compiled on 2/14/2014)". If the version is below 1.9, then you must update it as it is not compatible with Java 8.

It is most likely sufficient just to update to the latest version of Netbeans which comes with Apache Ant version 1.92. Or if you want to update the Ant version there is already a detailed stack overflow answer.

Share:
22,754
user3578539
Author by

user3578539

Updated on July 09, 2022

Comments

  • user3578539
    user3578539 almost 2 years

    I know this has been asked in other questions however. The fix was not explained enough for me. I am extremely new to java and all that comes with it. (I am Using netbeans)

    Im getting this error when running my program;

    Updating property file: C:\Users\Sam\Documents\NetBeansProjects\Assignment1\build\built-jar.properties
    C:\Users\Sam\Documents\NetBeansProjects\Assignment1\nbproject\build-impl.xml:926: The following error occurred while executing this line:
    C:\Users\Sam\Documents\NetBeansProjects\Assignment1\nbproject\build-impl.xml:268: Class not found: javac1.8
    BUILD FAILED (total time: 0 seconds)
    

    I read that i need to update my ant? How do i do that? I checked the website and it's really confusing for me.

    I also saw somebody suggesting to add "-Dbuild.compiler=javac1.7" to bypass having to update this. Where exactly in my code would i put that? Thanks for your time and advice in advance. It's really appreciated :)

  • user3578539
    user3578539 almost 10 years
    Im using netbeans 7.3.1 as its the version my university use, so im stuck with it, ill check out the link you posted. Tyvm for your response :)