Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding package to Java project structure

I have been working on a project locally and at some point I gave the project to someone else to work on. Since that time, I have created another package with classes and so on in my own project version. Since I want the other person to have this package, I gave him the package folder which he copied in the path ProjectName/src/packageName. Of course, he didn't see it right away, so I used New->Source Folder and refresh/clean/pray to make it work.

The question is: is there some other way to add packages to projects? as I'm not sure this is the right solution.

like image 359
CosminO Avatar asked May 17 '12 07:05

CosminO


People also ask

What is package structure in Java?

A Java package structure is like a directory structure. Its a tree of packages, subpackages and classes inside these classes. A Java package structure is indeed organized as directories on your hard drive, or as directories inside a zip file (JAR files).

How do you create a package structure?

Open the Object Navigator (SE80), choose the Repository Browser and Package as the repository type. In the input field, enter a name for the new package that complies with the Naming Conventions. Within SAP itself, the name must begin with a letter from A to S, or from U to X. Choose Create.


2 Answers

A refresh is sufficient after you have dropped the new source files inside the source folder. No need to add a new source folder.

The clean way to collaborate is to use a version control system, like Subversion, git, or whatever. Copying files between developers is a recipe for chaos.

like image 149
JB Nizet Avatar answered Oct 26 '22 22:10

JB Nizet


From backend, Go to ProjectName/src and copy/paste all the package, and then right click and select "Refresh".

like image 22
Anshu Kunal Avatar answered Oct 26 '22 22:10

Anshu Kunal