dionajie
dionajie

Reputation: 404

Create project from existing project Netbeans

I have downloaded some source code that contains src folders with some .java files. I want to try to run the code in netbeans.

This is the structure of the folder :

C4.5/src/main/java/myc45/

and in these folder include some .java files.

What should I do first?

Upvotes: 1

Views: 895

Answers (2)

fvu
fvu

Reputation: 32953

As an alternative to @PaulJAbernathy 's solution:

  1. create a new project in Netbeans
  2. via the projects windows, create a package myc45 (the package name used in the code you want to import) - you can do so by rightclicking, new Package
  3. now, inside the src directory of your project directory you'll find a directory called myc45. Drop the source files into that directory using whatever file browser you commonly use. You'll see that Netbeans picks up the files almost immediately in the project explorer.
  4. you can now use the code.

A bit messy, but there are advantages: if eg you want to transform a bunch of existing code files into a Maven type project, this is probably the easiest way.

Upvotes: 1

Paul J Abernathy
Paul J Abernathy

Reputation: 1003

When you create a project in Netbeans, one of the options in the project creation window is create project from existing source. If you have an existing project, you can also edit the project properties and tell it what the source folders are.

Upvotes: 3

Related Questions