This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 166215 - handle better "javac: invalid target release: 1.6" compilation error
Summary: handle better "javac: invalid target release: 1.6" compilation error
Status: RESOLVED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: Web Project (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: David Konecny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-28 20:13 UTC by Vince Kraemer
Modified: 2016-07-07 08:53 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vince Kraemer 2009-05-28 20:13:16 UTC
Steps to reproduce

1. start the IDE with JDK 6

2. create a web app project.

3. Set the Source/Binary Format property to the value 'JDK 6'

4. stop the IDE

5. restart the IDE with JDK 1.5

6. open the project created in step 2 and modified in step 3.

7. Try to clean and build the project.

You end up with a nasty looking error message in the ant output... [Poor feedback]
  'javac: invalid target release: 1.6'

I expected the IDE to provide some kind of warning about the problem when I opened the project in step 6 [Late].

If I open the project properties BEFORE step 7, the 'Source/Binary format' property shows up in red text with the value
'Illegal Source Level: JDK6', so it seems like we can determine that there is a problem BEFORE we have ant trigger the
javac task.
Comment 1 David Konecny 2009-05-28 22:19:57 UTC
Vince, I don't think this is P2 - you have to explicitly change your project's source level to 6 and later you are
trying to run it on JDK5 so clearly user should be able to make a connection. If source level 6 would be default for
projects created on JDK6 then I would agree with you that users may not be aware of what's happening and why suddenly
compilation fails.

I was about to move this issue to J2SE project but J2SE project seems to have a check for this: the project name is
displayed in red color if you run the same scenario on J2SE Project which I guess is slightly better although there was
no indication why the project is displayed in red. And trying to compile it you end up with the same error. Do you think
drawing project name in red color would be enough?
Comment 2 Vince Kraemer 2009-05-28 22:29:36 UTC
The steps are illustrative.  If the project is shared between users (via cvs, hg or the like), steps 1,2,3 may be
executed by user A; while steps 5,6,7 may be executed by user B...

I don't think just drawing the project name in red is enough feedback... though it is earlier, which is a good start.

This issue probably applies to each of the different Ant based project types that support a Source/Binary format property.
Comment 3 David Konecny 2009-05-28 22:36:10 UTC
I'm passing to J2SE project then - web/j2ee projects should just reuse/mirror Java behaviour. Once fixed in J2SE project
the fix should be transplant to web/j2ee.
Comment 4 Tomas Zezula 2010-10-12 14:01:17 UTC
Marking WONTFIX for j2se, may be valid for web project. The j2seproject solves this by marking the project as broken (red + badge) and marking the value of source level in the customizer as broken (red).
Comment 5 David Konecny 2010-10-12 20:36:27 UTC
(In reply to comment #4)
> Marking WONTFIX for j2se, may be valid for web project. The j2seproject solves
> this by marking the project as broken (red + badge) and marking the value of
> source level in the customizer as broken (red).

Web project could at least do the same: mark project as erroneous.
Comment 6 Martin Balin 2016-07-07 08:53:35 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss