unable to compile on command line...

View: New views
2 Messages — Rating Filter:   Alert me  

unable to compile on command line...

by hscowan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,
I have a project that compiles and runs using NetBeans. However, when I try to compile the programme from the command line I get errors stating “cannot find symbol” pointing to classes that do exist but are not found.
I compile, class XXX, which is called by class AAA. Class XXX compiles with no problem but class AAA has the error pointing to class XXX.

All classes for the project are in one folder (called MyClassFiles) on the hard disk as separate Java source files. Using import statements doesn’t work (which I expected).

I have checked the classpath variable in the advanced settings of Windows vista, it contains ".;" so I think that should be okay.

Any ideas would be appreciated.

-- Scott

Re: unable to compile on command line...

by Rainer Leonhardt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Scott,

this sounds as if you compile one class after the other?
Maybe you should compile your classes by calling them all at row.
You can user wildcards with javac.

With javac you can use the option to -classpath do define the folder,
where your referenced classes are. To define the folder, where the sourcecodes are
you can user the option -sourcepath followed by your path.

Maybe you should user both parameters to set your folders, where the sources
respectively the classes lay.

Hopefully this helps you.

--
Rainer

http://www.stuttIT.de
LightInTheBox - Buy quality products at wholesale price