?
Solved

JBuilder 3.5 - "cannot access class ..."

Posted on 2000-04-27
8
Medium Priority
?
215 Views
Last Modified: 2011-09-20
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
Comment
Question by:s_lavie
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 1

Expert Comment

by:cssathya
ID: 2755505
You have to add that package in the classpath in the "Project Properties".That should solve the problem.
0
 
LVL 2

Author Comment

by:s_lavie
ID: 2755666
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
 
LVL 2

Author Comment

by:s_lavie
ID: 2755795
The problem was that I had to add the jar file to the 'Required Libraries' list - and not to the classpath.
Thanks anyway...
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 2

Author Comment

by:s_lavie
ID: 2755796
This question has a deletion request Pending
0
 
LVL 1

Expert Comment

by:cssathya
ID: 2755925
This question no longer is pending deletion
0
 
LVL 1

Expert Comment

by:cssathya
ID: 2755926
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
 
LVL 2

Author Comment

by:s_lavie
ID: 2756106
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
 
LVL 1

Accepted Solution

by:
cssathya earned 150 total points
ID: 2756165
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

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Suggested Courses
Course of the Month13 days, 21 hours left to enroll

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question