• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 229
  • Last Modified:

JBuilder 3.5 - "cannot access class ..."

Hi,

I want to use the class com.xxx.AAA (a third company class), so its source path was added to the project properties.

When I write:

import com.xxx.

I can see the class AAA in the pop-up list (and I can choose it), but when I compile the project I get the following error:

'Error #: 302: cannot access class com.xxx.AAA; class com.xxx.AAA; not found in stable package at line ...'

What should I do???
0
s_lavie
Asked:
s_lavie
  • 4
  • 4
1 Solution
 
cssathyaCommented:
You have to add that package in the classpath in the "Project Properties".That should solve the problem.
0
 
s_lavieAuthor Commented:
cssathya,
 
Can you be more specific?

Is there a different classpath for the project? other the one of the OS (I'm using NT 4)?

If yes where do I define it?
Cause I added that package to the OS classpath, and it didn't help :-(

0
 
s_lavieAuthor Commented:
The problem was that I had to add the jar file to the 'Required Libraries' list - and not to the classpath.
Thanks anyway...
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
s_lavieAuthor Commented:
This question has a deletion request Pending
0
 
cssathyaCommented:
This question no longer is pending deletion
0
 
cssathyaCommented:
In adding the files into the project, you should also add the files that you are importing. so just click on add file on the right side and then add the specific third party files that you are using. that would make the code runnable.

whatever extra files that you are using, you have to include them in the project space.
0
 
s_lavieAuthor Commented:
Why should I also add the files that I'm importing? What if I don't have the .java files, but only the .class files (and I don't want to decompile them)?
After adding the jar file to the
'Required Libraries', it worked fine, so what is wrong?
0
 
cssathyaCommented:
In case you have the pre-compiled files, then you have to have it in the required libraries.

At some point or other the jproject has to know the files that it is going to use.

If you do not add them, it will still work from outside when u say java com.xxx.AAA but it will not work when you do it inside JBuilder.

when you add the libraries, it appends the internal classpath so that it can run the project.

that is the reason for adding required libraries.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now