How to resolve packaging problem
I have created 2 packages
1) Pack3 2) Pack4
Pack3 contains MyClass1.java and
Pack4 contains MyClass2.java
but in actual java files ,I have given package names as Pack1 and Pack2 respectively......
package pack1;
public class MyClass1{
public void find(){
System.out.println("GOT..?");
package pack2;
import pack1.MyClass1;
public class MyClass2{
public static void main(String args[]){
MyClass1 m1=new MyClass1();
m1.find();
System.out.println("......");
If I COMPILE WHOLE SOURCE AT A TIME then it compiles correctly and create directories pack1 and pack2 and respective classes in those directories but IF I TRIED TO COMPILE ONLY PACK4 DIRECTORY....THEN IT FAILS TO COMPILE......AND GIVES ERROR AS PACK1 DOES NOT EXIST...this is quite obvious..because MyClass2.java refers to MyClass1.java which is in PACK1 and pack1 does not exist on disk.
How to solve this problem...?
I want to compile only single directory at a time...I mean HOW TO COMPILE ONLY PACK2 even though actual package name is different than directory name in which it resides...?and I am not getting why it compiles when I compile whole source at a time.
Thanks,
Archan
Edited by: Archana144 on Apr 25, 2008 7:17 AM
First off, Pack3 and Pack4 are not packages. If they were, they would be included in your package declarations.
When you compile a class, you need to include package roots and .jar files in the classpath such that all the classes you're using can be found. When you compile both classes at the same time, the compiler knows about both of them and can find them. When you only compile one of the classes, you need to tell the compiler where the package root for the other class is.
[Link to Packages Tutorial|http://java.sun.com/docs/books/tutorial/java/package/index.html]
Similar Messages
-
Does anyone know how to resolve the problem of apps not being able to download in the App Store? After the IOS 6 update I haven't been able to download any apps.
Maybe here:
IOS 6 App store crash: Apple Support Communities -
I am having problems with the Preview application. When I try to use it to open a pdf document it gets hung-up and I have to select force quit to close it. Any ideas on how to resolve this problem? Thanks for any help
Can you open the Preview program without loading a file, like by itself?
If it doesn't load then I suspect a corrupt Preview preference file.
Deleting the System Preference or other .plist file
Can you open other files with Preview, like jpg's and images?
How about other PDFs? or is it just that one you have downloaded?
Run through this list of fixes
Step by Step to fix your Mac -
I am no longer able to double click on a file and have it open. Any suggestions on how to resolve this problem?
Please read this whole message before doing anything.
This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you turn on the computer, and again when you log in.
Note: If FileVault is enabled, or if a firmware password is set, or if the startup volume is a software RAID, you can’t do this. Ask for further instructions.
Safe mode is much slower to start up and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal startup may also be somewhat slow.
The login screen appears even if you usually login automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
Test while in safe mode. Same problem?
After testing, restart as usual (not in safe mode) and verify that you still have the problem. Post the results of the test. -
How to resolve the problem in jdeveloper903 oc4j starting:JspTagLib listener error
I just download a jdeveloper903,i hava a problem:
when i start the oc4j alone,it prompt "JspTagLib listener error:null". Then,After depoly the jsp application with JspTag to oc4j,I found the jsp page can not run,but,the jsp application can run in the
develope environment.
how can resolve the problem,help!!Thanks.I think you might have better luck asking your question in the JDeveloper forum at:
http://forums.oracle.com/forums/forum.jsp?id=315684
later -- Jeff -
I receive error messages when I am downloading free iphone apps. I get error message 9810 and 9834. Can anyone advise how to resolve this problem? The problem doesn't exist when I'm downloading apps for which I pay.
Hi,
See Here:
http://support.apple.com/kb/TS1276
From Here:
http://support.apple.com/kb/TS1424 -
could not be updated because of the firmware file is not compatible (how to resolve this problem or ios 6 could not be used on iphone4?)
Do you have iTunes 10.6.3?
If not, update iTunes first then try again. -
Hi
I am having problems sending emails when using my ipod touch with wi-fi abroad. When at home my ipod touch receives and I can send emails through my home wi-fi system but when away and logged into other wi-fi networkcan only receive emails and not send them. Internet access is fine when abroad.
I am assuming that this is to do with the outgoing server but this is only a guess!
I am not very techy so any ideas how to resolve this problem would be gratefully received.
Thanks
KeithGHSeems like the other networks are blocking you from sending emails.
Do yo have more that one email account on the iPod?
Have you tried sending from another account? -
how to resolve this problem. During ti install the new verson in my iPhone appear "The iPhone could not be restored. An unknown error occourred (1015)
You can't resolve the issue. Your phone is bricked.
This is the error message that happens when you try and update a jailbroken phone.
Discussion of jailbroken phones is prohibited by the Terms of Use of this forum.
You need to buy another phone. -
Hello! Tried unsuccessfully to restore my MBP, running the Mac OSX Lion, to factory settings. I keep getting the "can't download additional components for the Mac OSX Lion" error when reinstalling the OSX Lion. Any tips on how to resolve this problem?
Hi
Given that your answer to 1. is 'pre-installed' and 3. is 'No', I think the only thing to do is to take it to an Apple store (ideally the one you bought it from) and have them reinstall it for you.
The intended solution in cases like yours is that you should be able to reboot and install even a wiped disk by using Apple's servers over the internet (you do this by restarting with 'command-r' and choosing 'reinstall Lion'). However if this isn't working for you then you need to get the store to do it. Don't let them fob you off with 'go home and try again'. Have them do it in the shop (you're still covered by Applecare warranty so it should cost you nothing save the inconvenience of the trip and possibly leaving the machine there while they fix it).
A reinstall should leave all your own personal data and programs in place.
Note for future: when you get it fixed, first thing to do is buy a cheap external drive and start keeping a backup (either Time Machine or clone with Carbon Copy Cloner).
Message was edited by: softwater -
my Justin.tv app doesn't have sound....any idea how to resolve this problem?
Hi. I was having this problem too but the sound works for me when I plug in the headphones. I guess it's more of a workaround but I'm happy with it. Hope this helps.
-
i have recently purchased the highest storage but was unable to backup my phone via icloud, the button on my iphone to backup on icloud is grey out, anyone knows how to resolve the problem? What's the point of purchasing the biggest storage?
First check that your device is correctly connected to the wifi/internet (settings > wifi)
If your back up continually fails, you might try turning off back up on your mobile device (settings > iCloud > storage & backup) and then deleting the backup file from iCloud by swiping the backup file on the mobile device (settings > iCloud > storage & backup > manage…) and then turning back up on again.
If this doesn't help, try turning off some items for back up in a pattern to try to establish if your problem is being caused by specific data on your device.
Being able to back up to the cloud can be very useful, especially if you don't have access to a computer or have infrequent access to one, however unless you specifically need to use iCloud for back up, you will find backing up to iTunes significantly more convenient and possibly more reliable.
More about iCloud v iTunes Back Up -
purchased new songs from itunes and when I clicked on the Sync button those new songs are not added to my ipod nano. Have any idea how to resolve this problem?
Do you have the right boxes checked to sync the music to your iPod?
iTunes: Syncing media content to iOS devices and iPod
Do they play in iTunes on the computer?
Have you successfully synced music form this iTunes library/computer before? -
Hi my iPad displays "iPad disabled connect to iTunes" when I connect it to iTunes it keeps asking for me to enter password but I can't because the iPad is disabled. Can anyone please advice how to resolve this problem. Thanks
Best regards
iPad 2, iOS 6.0.1You may need to put the iPad into recovery mode : http://support.apple.com/kb/ht1808 - you should then be able to reset the iPad and restore/resync your content to it
-
The headphone jack on my macbook air isn't working. I have plugged in two headphones and both won't work although they do work on other devices. Any ideas on how to resolve this problem?
update to latest OSX 10.9.3
reset SMC , you likely put your Air into sleep mode with phones attached.
update the OSX to fix the issue.
Maybe you are looking for
-
Using the fileReference class to upload image
I've been using the loadVars to upload text and pass variables to php and onto the server. I've begun using the Flash Filereference class so an image can be uploaded directly from a Flash movie, not involving an html form. But within the Filereferenc
-
My HP C6300 All in one has suddenly stopped working
Both Printer and Advent laptop tell me that they are both connected to my Netgear router but nothing happens. When I click on the printer logo all I recieve is an 'Error' message! I have tried everything on the support site without success. I am usin
-
Hello! I am establishing Business Process Monitoring functionality. When I activate the monitoring I get a lot of warning "Could not change MTE customizing code 2 (MTE: <SID>\Dialog...\DBRequestTime)" <b>How critical are these warnings and how to avo
-
Cisco WLC 5508 assigning different SSID to few APs
Hello Everyone, I have a WLC 5508 runing 8.0 Presently one SSID is assigned to all th APs registered with my WLC. I want a different SSID to 2 of APs. Can anyone tell me how to do this?
-
I just started with Elements 11 and imported my iPhoto library. I am unable to delete pictures and get the above error when trying to create albums. Any suggestions of why I can only have 3000+ folders and unable to organize? I also tried to impor