3

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 :)

nanofarad
  • 40,330
  • 4
  • 86
  • 117
user3578539
  • 255
  • 2
  • 3
  • 7
  • 1
    This suggests that netbeans is not running the compiler with the correct options. I would check you have the latest version of netbeans as it looks like a bug. – Peter Lawrey May 04 '14 at 13:36

1 Answers1

1

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.

Community
  • 1
  • 1
Kent Shikama
  • 3,910
  • 3
  • 22
  • 55
  • 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 :) – user3578539 May 04 '14 at 14:27