473,407 Members | 2,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Some trouble with packages

I've started studying java using the tutorial on Oracle. I've been making a program as I've gone along in the tutorial, adding what I learn to the program. When I reached the packages section, I tried packaging my program. However, after I set up the package, my files couldn't find each other. After a couple frustrating hours of trying to fix it, I made a simple package with the following files:

C:\Users\Kenny\Desktop\testpackage\TestSuperClass. java:

Expand|Select|Wrap|Line Numbers
  1. package testpackage;
  2. public class TestSuperClass {
  3.  
  4. }
C:\Users\Kenny\Desktop\testpackage\TestSubClass.ja va (ignore the space)

Expand|Select|Wrap|Line Numbers
  1. package testpackage;
  2. public class TestSubClass extends TestSuperClass {
  3.  
  4. }
I can compile TestSuperClass.java, but when I compile TestSubClass.java, I get the following error:

Expand|Select|Wrap|Line Numbers
  1. TestSubClass.java:2: cannot find symbol
  2. symbol: class TestSuperClass
  3. public class TestSubClass extends TestSuperClass {
  4.                                   ^
I've set up the appropriate folders for the package and set the directory to my classpath. I've been trying to figure this out all day. Can someone explain to me what I'm doing wrong?
Dec 14 '10 #1
6 1539
Dheeraj Joshi
1,123 Expert 1GB
My test program compiles properly. Are you sure all the class paths are correct?

Regards
Dheeraj Joshi
Dec 14 '10 #2
I should think so. I unset the classpath then set it to the folder.

Expand|Select|Wrap|Line Numbers
  1. set CLASSPATH=
  2. set CLASSPATH=C:\Users\Kenny\Desktop\testpackage
Dec 14 '10 #3
Dheeraj Joshi
1,123 Expert 1GB
Try compiling your main method with -cp option from command line and check.

Regards
Dheeraj Joshi
Dec 14 '10 #4
I'm not entirely sure what you mean. Sorry, Java is a bit difficult for me to understand.
Dec 14 '10 #5
Dheeraj Joshi
1,123 Expert 1GB
Check this link.

Regards
Dheeraj Joshi
Dec 15 '10 #6
I entered the following line:
Expand|Select|Wrap|Line Numbers
  1. C:\Java\jdk\bin\javac -classpath C:\Users\Kenny\Desktop\testpackage TestSubClass.java
and got the same error. Do you think it might be to do with my Java installation?
Dec 15 '10 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: nephish | last post by:
Hey there all, i have a question about how to point my python install to my sql database. when i enter this: db = MySQLdb.connect(user="user", passwd="pass", db="myDB") i get this: Traceback...
2
by: Dead-Cell | last post by:
The VC complier told me the RecordSet was read-only while I were trying to insert some record into database. My work environment is VC 6.0, SQL server and ODBC¡£ Please tell me, how to open a...
3
by: PaulR | last post by:
Hi, I am trying to understand what invalidates Dynamic Packages in the Package Cache. By monitoring the Size of the Package Cache, it appears the following does 1. Performing a Runstats on...
1
by: marick66 | last post by:
I am trying to write a program that takes a test score into an array and prints out the scores into a histogram, I can't figure out how to get count each test score and remember it to turn it into...
2
by: gdorian | last post by:
Hello Everybody, this is my first thread in this newsgroup :) First of all, I wanna explain : I've a DB2 installed in AIX O.S.; I've a remote server (OS400) in which there are some applications...
6
by: 3than7 | last post by:
I am writing an application to solve Pythagorean Theorum Problems. This is on my own time, i am using a book to learn c++, and after doing a fahrenheit to celsuis program from that book, i wanted...
1
by: pankajit09 | last post by:
Hello !! I updated my packages in Debian. After updation it shows a lot of packages to be removed,upgraded and installed. Why is it showing a lot of packages to be removed ? Those are...
14
by: gsherp | last post by:
I can't seem to get getElementById to work when I create an element in an external js file. example... function blah(){ var temp=createElement("input"); ...
24
by: GesterX | last post by:
First of all I'm new to this site but it certainly looks like a place that i will be visiting more often! Onto my problem. I am creating a Hotel Bussiness project in java using BlueJ The...
5
by: p vs np | last post by:
Hi. I have been trying to fiddle around with some layout managers, the CardLayout in particular. The idea I had was : I must be able to accept multiple panels on one frame, i.e, i must have the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.