Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Package Problem -sick and tired

807591Feb 26 2008 — edited Feb 28 2008
Hi,
I am trying to access a Java class created by Netbeans 6.0 the name of the class is Project2View.class this class is being created by GUI of Netbeans. The package path is default path set by Netbeans 6.0 ie: C:\Users\arunim\Documents\NetBeansProjects\Project2 (Project2 is the package name)...... This class dynamically load another client class during run time, the code for which is

//import project2.*;

public class plugin {

public BufferedImage getimage()
{
//Project2View resource = new Project2View();
}
public void setimage(BufferedImage im)
{
//Project2View resource;
}
}

I am able to compile/access this plugin.class on runtime and it's methods no problem with that but if i uncomment the lines
1. //import project2.*;
2. //Project2View resource = new Project2View();
3. //Project2View resource;

The class is not able to get compiled says package project2 not found. Both the class Project2View and plugin are in the same package but at different file depth.

The location of the above stated class(plugin) is "C:\Users\arunim\Documents\NetBeansProjects\Project2\custom" and that of the Project2View.class is "C:\Users\arunim\Documents\NetBeansProjects\Project2\build\classes\project2" (<-- is what i suppose it is the class path cos this is the only location i can search it) the compile path of the plugin class is "javac -classpath C:\Users\arunim\Documents\NetBeansProjects plugin.java"

I am pretty sure that it's a path problem since when i write the same code by adding a new package/class from GUI the code run perfectly.

This is my first post on the forum hoping for some help.

Edited by: raven_roy on Feb 26, 2008 12:34 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 27 2008
Added on Feb 26 2008
11 comments
114 views