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 167498 - Core java classes not found for code assist
Summary: Core java classes not found for code assist
Status: RESOLVED WORKSFORME
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P1 blocker (vote)
Assignee: Rastislav Komara
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-23 00:21 UTC by daik
Modified: 2009-06-24 09:09 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Test project that illustrates the problem (10.23 KB, text/plain)
2009-06-23 23:39 UTC, daik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description daik 2009-06-23 00:21:25 UTC
Core java classes seem to not be found by code assist. This issue is not present in 6.7RC2. Look at the following (new
"java application" created in 6.7RC3).

package javaapplication1;
public class Main {
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
       PrintStream out = System.out;
    }
}

NB correctly finds that PrintStream is unknown. Clicking the little light bulb to fix the problem only gives the option
"Create class PrintStream .."
I have this issue not only with core java classes but any classes including classes inside the same package. Sometimes
the import is marked as invalid, but the code compiles both through NB and external ant.
Further if I manually type "import java." +ctrl+space I get "No Options" if I then enter "io" I get the options I would
expect.

As a further note probably related to this (I can log this as a separate issue if you want me to). When I have two
projects A&B where B has a dependency on A and this is set up as a dependency on the Project not to a jar, it only finds
a subset of classes in the jar. Again both projects compile just fine through both NB and externally. Removing the
project dependency and instead make the dependency to the jar seem to fix this problem.
Comment 1 Jiri Prox 2009-06-23 10:01:31 UTC
Can you provide sample project where you can see this behavior? Is java platform configured correctly?
Alternatively you can try starting IDE with fresh userdir ( using --userdir c:\empty_dir switch) and see it the problem
persists.

To the second problem: has all classes in jar their .java counterparts in project? (e.g. there is no additional class
added, such  web services ... )
Comment 2 daik 2009-06-23 23:39:40 UTC
Created attachment 83968 [details]
Test project that illustrates the problem
Comment 3 daik 2009-06-23 23:50:36 UTC
I have attached the test project I used when reporting this.
The java platform is configured identically to the java platform I use for rc2. (and in rc2 it works fine).

Running with a fresh userdir seems to have fixed the problem. I will try to clean my user dir and open all my projects
again.

For the second problem. Yes all classes have their java counterpart, there is no generated code, or other dependencies
(except for java SE classes). I will try this again when I have cleaned my user dir and see if it is still a problem.
Comment 4 daik 2009-06-24 00:01:35 UTC
Cleaning the userdir solved both problems. Not sure how my userdir became corrupt but cleaning it and re-open all
projects seems to have solved all the problems I had in this bug. 
Comment 5 Marian Mirilovic 2009-06-24 08:21:43 UTC
reopen - worksforme
Comment 6 Jiri Prox 2009-06-24 09:09:25 UTC
worksforme - not fixed