Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 02-28-2006, 07:25 AM   #1
Registered: Jul 2004
Location: Rochester, NY
Distribution: Fedora9::FreeBSD7.1
Posts: 296

Rep: Reputation: 30
Program defined class--Java

Im having trouble compiling an application that uses one of my own classes. I created a class called PhoneBook which is used by AddressBook.

I compiled PhoneBook first since AddressBook requires the phonebook class. However, when I go to compile it I get errors about using the class which leads me to believe it canít find the class. I have and sitting in the same directory also. Is there something Iím forgetting to do?

All help appreciated!

Old 02-28-2006, 10:03 AM   #2
Registered: Nov 2005
Location: Mauritius
Distribution: PCQLinux, SUSE Linux,Fedora Core 5, Fedora Core 6, Knoppix Live, Kubuntu Edgy, PCLinuxOS
Posts: 167

Rep: Reputation: 30
you should include the classpath attribute when you are compiling eg:

(for linux)
javac -classpath "path1: path2: path3"

(for windows)
javac -classpath "path1;path2;path3"
Old 02-28-2006, 11:47 AM   #3
Senior Member
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 60
phonebook will be compiled when addressbook is compiled, so u can just compile address book rather than both of them. (this isnt solving your problem, but its a tip)
Old 02-28-2006, 04:07 PM   #4
Registered: Jul 2004
Location: Rochester, NY
Distribution: Fedora9::FreeBSD7.1
Posts: 296

Original Poster
Rep: Reputation: 30
The problem

The problem was actually the IDE i was using.

Im using a free IDE called textPad which has some nice lightweight features. For some reason when i set the macro to compile with -classpath it doesnt work. However, if i do it from the command line i have no problems.

I guess my problem was the IDE.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
java tree class true_atlantis Programming 1 08-30-2005 12:03 PM
Running a Java executable class from another executable class LUB997 Programming 22 07-24-2005 04:57 AM
How to launch a program as a defined user at startup. Linux.tar.gz Linux - Software 2 03-20-2005 11:28 AM
Compile Java - .class, .java, .jar ? woranl Programming 2 11-09-2004 10:12 PM
Java: Can't remember class coolman0stress Programming 0 11-04-2003 07:08 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:43 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration