Rafi
Rafi

Reputation: 1922

Eclipse - How To Remove Packages

I just started taking this Distributed Systems class, and my teacher says the following on our class website:

Please do NOT use packages! If your configuration of Eclipse uses them by default, please remove them before writing code!

What the heck is she talking about? I thought eclipse NEEDS to create packages for your project source files to stay organized. How do I remove them?

Upvotes: 5

Views: 16064

Answers (2)

Dhirendra
Dhirendra

Reputation: 790

Just remove the first line of your code if exist that says:

package <package-name>;

And if you are creating a new class, then don't give any package name.

Upvotes: 1

b4da
b4da

Reputation: 3108

Packages are not mandatory. If you create a new project in Eclipse, you can directly add your classes to src folder. These files will be under /workspace/project_name/src/ folder. If you add a package, your class files will be placed under /workspace/project_name/src/package_name folder. Your instructor will need to know package names to be able to compile your files and she is probably using a script or something to automatically compile them and that script assumes your files are placed under src folder.

Upvotes: 4

Related Questions