Narek
Narek

Reputation: 39881

Java other directory for src

I have packages that don't want to place in src folder in order to compile. Can I setup Eclipse so that other directory along with src would act as a source directory?

EDIT: When I do Build Path > Use as source folder on the folder which contains com/some_package/classes/*.java then error in Eclipse disappear but in command line compile time I get cannot find symbol error. Whereas, when I copy the same com.some_package/classes/*.java into src directory it works in eclipse and compiles command line too. How to fix command line compilation too?

Upvotes: 1

Views: 115

Answers (3)

A1ternat1ve
A1ternat1ve

Reputation: 86

This isn't exactly an answer to your question but folks who use IntelliJ could just right click the directory --> Mark Directory As --> Sources Root.

Upvotes: -2

Adi
Adi

Reputation: 2394

Yes. Go to your Project properties -> Java Build Path. You will see Source tab there.
Use that to add your source directory.

Upvotes: 0

Sotirios Delimanolis
Sotirios Delimanolis

Reputation: 279880

Yes, you can select any folder in Eclipse, right click and choose Build Path > Use as source folder.

Upvotes: 3

Related Questions