I'm trying to automate the creation of an Eclipse Java project .
I need a way to do this using the command line.
I found many articles for this for CDT, but not for the java one.
Is there a way to do that with Java IDE?
Principles of my solution:
.project
and .classpath
files from existing projects Below is only the relevant part/end of the script, where .project
file is created.
Note: I did not need a .classpath
file in my case, thus only importing a Project, not Java Project.
# name: the local Eclipse Folder name I give as script arg
# Create Eclipse .project
projectFile="${name}/.project" ;
# below EOF's content comes from an existing real .project file
echo $( cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>${name}</name>
<comment></comment>
<projects></projects>
<buildSpec></buildSpec>
<natures></natures>
</projectDescription>
EOF
) > ${projectFile};
echo "✓ ${projectFile} created" ;
# Create Eclipse .classpath if needed (in case of Java project, not needed for default Project)
...
After this:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.