Import source project in eclipse - java

I need to import a source Project in eclipse. The project is made by many folder like Classes (that contain .class files), src(that contain .java files) and many others. The source project and the instructions on how to set up eclipse are reported at this link. I tried to follow them but I haven't got anything. I think this is a simple thing but I'm new to eclipse.
My eclipse actual version is eclipse java neon 2.
My OS is ubuntu.

You could choose to create a new Project from the File Options and then select Project from existing sources which choosing the source directory.
Second approach could be to just use File > import Project wizard.

Related

How can I import .java file in eclipse IDE?

I downloaded Java exercises from exercism.io, I use the Eclipse IDE. I can create new projects in Eclipse and work on them, but can't figure out how to import 'filename.java' and adjust that!
How can I do it? I'm using Ubuntu, do you recommend me to use a different IDE than Eclipse for Java projects?
Go to File -> Import -> Genereal -> FileSystem -> Then select a directory of the file located and then -> select the files you want to import thats it. This is for eclipse Mars
Create a new JavaProject
Create a new class in that java project (located in workspace)
Name the class the same as the .java you want to import
Then simply copy and paste your java code into Eclipse
There is this One way you need to create a new java project in Eclipse then you need to navigate to workspace of Eclipse which is where eclipse stores all java files then locate the project folder you created and then copy-paste all those java files in this project folder.

How to edit an eclipse plugin?

An eclipse plugin called JDTCommentsV2_1.0.9 does the following in eclipse:
I'm trying to add/edit some comments inside. e.g. add Run TestComment or just change one of the comments' name.
I have the .jar file and here's how it looks inside:
Question is which files should i edit and how.
Thank you
edit:
After following #greg449 and #Robin Green's instructions, I exported the jar file to eclipse, and edited the plugins.xml file. But if i export the files now as a jar, it doesn't work (nothing is changed in the menu). Finally i tried what #Robin Green said (Run -> Run As -> eclipse application) but there is no eclipse application under Run As. I got only Java Applet and Java Application. I'm wondering why. Might it be because i'm using ADT?
edit2:
I downloaded another version of eclipse (not ADT) and here i do have the Run As eclipse application bar". Can't i add it to ADT ?
edit3:
The picked answer works for eclipse JDT and not eclipse ADT.
It looks like you have a jar containing an existing Eclipse plugin so in your Eclipse you do File > Import and choose General > Existing Projects into Workspace and select the jar as the source.
Once you have the plugin project installed in your workspace you are going to have to work out how the plugin works by looking at the source and the plugin.xml.
Once you have modified the plugin use Export > Plug-in Development > Deployable plug-ins and fragments to build a new plugin jar.
Generally speaking you check out the source code from its source control repository or download it as an archive file from its website and then import it into Eclipse, same as any other project.

Importing a checkout svn source code as java project in eclipse

I have a project whose source code is hosted in svn and I have checked out the source code already say in a folder "myfolder". The directory structure of my code is as follows:
myfolder/trunk/src/ is where my code resides. Now I create a Java project using eclipse using File -> new java project with the location to be myfolder/trunk/src/. When I do this, all the package structure gets changes and I have errors in my sources files.
It would be great if somebody can tell me what is the correct way to do this. I have found some articles on the internet, but the more I read the more I get confused.
Thanks
Vandana
You should have probably chosen to Import Existing Project into your workspace and you should try that instead. It works great as long as you have your .project file defined. To fix the errors you have now, Create a new src folder in your project and point it at trunk\src, so that it correctly recognizes all your Java files.
You probably should use myfolder\trunk as the root of your project, rather than myfolder\trunk\src. As Perception has mentioned, try to "Import Existing Project" first (rather than start a new project and point it at your source).
First, I assume you already have subversive/subclipse plugin installed in your Eclipse and you have used the right URL to import your source code.
Before checkout your source code, you may change your perspective to Java perspective.
Then you only need to use File-Import-SVN(choose SVN as your import source)-Checkout projects from SVN-Next-Give your project a Name-Finish.
If you have problem about installing SVN plugin, reference is http://subclipse.tigris.org/
http://www.eclipse.org/epsilon/doc/articles/epsilon-source-svn/

How to import existing files into IntelliJ 10 IDE?

I have used Eclipse before. I changed to IntelliJ. Now I am wondering how to import existing files into IntelliJ 10 IDE. In Eclipse I was used to just drag the directory into the src folder, but I cannot do it here.
IDEA doesn't have such feature, you either set up a project on top of the existing sources or you copy files to the existing project externally, using Finder or your favorite file manager.
Actually you can tell IDEA to open a project and when you get prompted with the file explorer you select the eclipse project file. IDEA will then create it's own specific project files and setup the classpath for you. It's pretty nifty.

How to import java classes from other projects in NetBeans 6.8?

I have just started playing with Java, and I really like the language. I am using the NetBeans IDE, and I find one odd oversight. I can create a new class in a project, but NetBeans doesn't appear to support any way to import an existing class into a project.
I manage to get it done by going to some other project where the desired class already occurs, and then I copy/paste it into the source code folder of the new project, then change the package name at the top of the pasted file to match the package name of the new project.
Is there a nice direct way to do this from the NetBeans interface?
Thanks for any help on this.
In the Projects window you can expand the project that you are working on. Right Click on Libraries and select Add Project.... You will get a dialog allowing you to select another Netbeans Project with the Java classes that you wish to use.
You have to just make the .jar file of that/those java files which you want to use in another project.
right click on file->export->java->.jar then finish.
Now you can use these jar into your another project.
When you build the java project in netbeans it creates a jar file on the dist folder in the current project directory.
You can use this jar file for the other project as a package by adding this as ADD jar in the next project.I have tried this ,i am using my old project jar file for new project development.
Use the 'Clean and build' your project option from the netbeans application, that creates the 'dist' folder which you are looking for (and obviously can't find because you havn't cleaned&buld)
The netbeans itself creates .jar files and you can add the jar file to the current project you are working on.

Categories