Bug 53347

Summary: <javac> fails by default on JDK 8
Product: Ant Reporter: Jesse Glick <jglick>
Component: Core tasksAssignee: Ant Notifications List <notifications>
Status: RESOLVED WORKSFORME    
Severity: major CC: jan, jglick
Priority: P2    
Version: 1.8.3   
Target Milestone: 1.9.0   
Hardware: PC   
OS: Linux   
Attachments: Java8-Sample: Sourcecode
Java8-Sample: Buildfile

Description Jesse Glick 2012-06-01 19:11:24 UTC
Revision 1236803 (in 1.8.3) added some JDK 8 support. Unfortunately running <javac> by default fails with this error:

  Class not found: javac1.8

Workaround is to pass -Dbuild.compiler=javac1.7.
Comment 1 Jesse Glick 2012-06-01 19:19:13 UTC
Committed revision 1345316.
Comment 2 Martin Gainty 2015-04-22 22:52:04 UTC
Apache Ant(TM) version 1.9.2 compiled on July 8 2013

javac 1.8.0_40

java.exe -version
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)

Not fixed ..ANT does not work with JDK 1.8
M-
Comment 3 Jan Mat 2015-04-23 06:24:11 UTC
Created attachment 32680 [details]
Java8-Sample: Sourcecode
Comment 4 Jan Mat 2015-04-23 06:26:09 UTC
Created attachment 32681 [details]
Java8-Sample: Buildfile

I did an example which works for me.

Ant: 1.9.4
Java: 1.8.0-ea (I know, I should update ....)


Buildfile: C:\temp\ant-test\build.xml
   [delete] Deleting directory C:\temp\ant-test\build
    [mkdir] Created dir: C:\temp\ant-test\build\classes
     [echo] Java-Home: C:\seu\jdk1.8.0_b87\jre
     [echo] Java-Version: 1.8.0-ea
    [javac] Compiling 1 source file to C:\temp\ant-test\build\classes
--> wait for the swing gui
--> and click on the button
     [java] Click Detected by Lambda Listner
     [java] Click Detected by Anon Class

BUILD SUCCESSFUL
Total time: 7 seconds