Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a project that I'm doing for school that is several classes big, and has about 10 jpgs that go along with it. Since I recently installed mandrake, I was going to try to get java working. I installed the jsdk, and got it to successfully compile and run a small one class java application. but when I tried to do something multiclass, it doesn't recognize any of the other classes outside the main file. What do I need to do? In windows, I can just compile the file with main, and it'll find all the others if they're in the same dir. What do I need to do here? thanx.
Public and static are two different things. If you dont make the methods in your classes static and try to reference (use) them from other classes you will get an error. One other way to get over this problem is to create an Object of the class before using its methods.
My point was that there's no need to declare everything static. Actually, my point was wrong anyway - there's no need to declare public either, as the default protected is fine for classes in the same package.
I Know how to code java. Like I said, it compiles just fine under windows. It's just in linux, the compiler doesn't find the other classes like it does in windows. A friend of mine mentioned something called ant. anyone know what that is or how I can install it and use it to compile my source?
If your classes are in the same folder there shouldnt be any problems. Could you please tell us if the files are in the same directory and also post the javac output error that you get?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.