Bug 35111 - Does not compile under Java 1.5 because not recogize generic <cast> and new loops (with : )
Summary: Does not compile under Java 1.5 because not recogize generic <cast> and new l...
Status: RESOLVED WORKSFORME
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.6.4
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL: http://java.sun.com/j2se/1.5.0/docs/g...
Keywords: JDK1.5
Depends on:
Blocks:
 
Reported: 2005-05-27 21:40 UTC by Adam Nowakowski
Modified: 2008-02-22 12:18 UTC (History)
0 users



Attachments
It's example class about generic problem in Java 1.5 (2.27 KB, application/octet-stream)
2005-05-27 22:00 UTC, Adam Nowakowski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Nowakowski 2005-05-27 21:40:33 UTC
Not recognize enhancements in JDK 5
-generic 
Example:
 private Vector<MyClass> myvector;
               ^^^^^^^^^
-Enhanced for Loop
Example:
for (MyClass p : myvector) {
               ^
Comment 1 Alexey Solofnenko 2005-05-27 21:45:28 UTC
Did you specify source="1.5" ?
Comment 2 J.M. (Martijn) Kruithof 2005-05-27 21:45:53 UTC
Do you mean that you cannot compile classes using the javac task when the source
code contains JDK 1.5 features?
1) did you use the source attribute of the javac task?
2) Does your JAVA_HOME environment variable contain the directory jdk1.5 is
installed in?
Comment 3 Adam Nowakowski 2005-05-27 22:00:48 UTC
Created attachment 15189 [details]
It's example class about generic problem in Java 1.5

Run ant tu build javadoc.
Comment 4 Alexey Solofnenko 2005-05-27 22:07:20 UTC
After setting JAVA_HOME to jdk 1.5 the test worked without any problems.
Comment 5 Adam Nowakowski 2005-05-28 17:31:24 UTC
Adding JAVA_HOME resolve partial problem.
Another problem is with setting classpath for javadoc.
Solutions: delete CLASSPATH from environments.
Links about that:
http://forum.java.sun.com/thread.jspa?threadID=551665&tstart=45
http://forum.java.sun.com/thread.jspa?threadID=567807&tstart=75