Running Eclipse JDT from sources - eclipse

I want to run Eclipse Java Development Tools form source code, but I'm stuck after checking out codes from eclipse repositories.
I've checked out all plugins from org.eclipse.jdt and imported them into my workspace, but after this I'm stuck.
There is lot of errors so obviously there are dependencides missing, but I don't know what else is needed to import/install in order to make this work.
I've read tutorial by Lars Vogella about working with Eclipse source codes, but it only covers examination of codes.
http://www.vogella.de/articles/EclipseCodeAccess/article.html

The Eclipse Classic Edition has the source-code of JDT and PDE integrated. After downloading and starting Eclipse Classic you can open the View "Plug-ins", select the JDT Plugins and select "Import as..." -> "Source Project" via Context-Menu

Following up our discussion, you should make sure that the versions of the plug-ins you check out from the source repository are consistent with those installed on your Eclipse. You can check out the source code of your installed plug-ins by going to the plug-ins view, right-click on the JDT plug-ins and choose Import As -> Project from a Repository... and select Import specific versions below.

A simple way is to
- File > Import
- Plug-ins and fragments
- On the next screen under 'Import as' select 'Projects from repository'
- On next screen, use filter as 'org.eclipse.jdt' and import all the matching plugins.

Related

How to find the execution steps of an Eclipse plugin project

I am using Eclipse JUNO IDE in which I have imported an eclipse plugin project.
When I execute the project, a new copy of the eclipse window is opened and the plugin is displayed in the File Menu as "New Sample Project" in between the "New" option and "Open File" option. The plugin works normally.
From this project I wanted to know which file executes first and how the execution proceeds.
While this is the way to find the order of execution of a simple java program, is there a way to find the code execution order of a plugin project, which has many packages and each package has many java files?
I am new to eclipse plug-in development. Please help
Eclipse plugin project is different than normal Java project and also its execution.
Before jumping into execution steps, I think you better go through plugin project Manifest file details. It will give you overview of plugins that are contributed into your new eclipse instant and their implementation class in project.
Go through different tab in the manifest file. I will brief some of important things for you:
Overview: General info of you plugin. In general information section you will find Activator, which points your activator of plugin which will load your plugin.(You can say it as starting point as it controls plugin life cycle but not clearly starting point)
Dependencies: Plugins required and on which your projects are depended.
Extension: Here you will add Extension Points required for your plugin like view, editor, action,command. Here you can see overview of things which will be contributed through your plugin project.
Hope this helps.

Easy way to find which Eclipse version and plugins are needed for existing Eclipse project

I was given a working Eclipse project in Java. If I open it in some version of Eclipse then I get numerous errors. I get them because my version of Eclipse differs (it is not web developer) and vaadin and ivy plugins were used to create the project. How can I understand which version of Eclipse and which plugins are needed? I can get some sense by looking in .setting folder. There are a lot of files with names as namespaces related to plugins. Is there more direct or automatic/semi automatic way to find which plugins and Eclipse version are needed?
No. The Eclipse developers expect you to know your tools and if you take over a project from someone else or join a project, that someone explains to you how to install and configure Eclipse.
To find out which Eclipse plugins you need, look into the file .project and the folder .settings. Google for the file names and plugin IDs to see what they might mean. Usually, the third word of the name is the project (org.eclipse.jdt.* -> JDT project).
For missing classes, you need to look at the classpath. The easiest way to do that is to right-click on your project name and then select "Properties" from the menu. There is an entry "Build Path" which contains all the dependencies. Click through the tabs to see what you need.
For plugin projects, look into the file META-INF/MANIFEST.MF; Eclipse should open a special editor when you open it which has a tab for dependencies.

How to use SVN to build a library

I am trying to follow a tutorial, and I am told to:
1- Get the source code for the Java EMV Reader library from http://code.google.com/p/javaemvreader/ and build it.
2- Drop the resulting jar file in lib/.
3- Import the project in Eclipse and build it.
I right click the java files, and choose run as but don't get an option to run as Java Application. I also can not export the files as a JAR file. I have enclosed an image of what I have
After the first comment, I right clicked on my project, and under Maven, chose the option "configure as Maven" project. ( Thank you so much; this must be one of the fastest resolutions in the world )And I can now run the project. I get the window in my pic2, which I have attached. I don't however know what step 2 of the above instructions means. I don't see a lib/ folder. And the project he is refering to in step 3 is on git. Any ideas on what he means? ![pic2]!1
Eclipse projects have a "type" and that controls what tools are available. You probably created a "Basic Project" which means there are no compilers or other Java tools associated with it. You would want to create a Java Project in Eclipse.
That project does not seem to have Eclipse .project and .classpath files checked into the repository. It does look to be a Maven project however. So you would either want the m2eclipse plugins installed, and check this out as a Maven project, which would handle configuring everything else, or you want to use the Checkout As ... option and use the wizard to create a new Java project to checkout.
These are more Eclipse IDE questions than SVN or Subclipse questions.

Cannot import eclipse source code

I've followed this tutorial (Step 2) to a tee on how to import the eclipse source code so that I can explore the various packages in order to assimilate some certain aspects of the code. I can import the plugin, but I can't see any source files, only binary class files. Does anyone know how I can download and view the eclipse source code? It does not seem straightforward at all.
Open Eclipse
Open menu 'Help' -> 'Install new software'
Select 'The Eclipse Project Updates'
Select 'Eclipse SDK' and install/restart
Open menu 'Window' -> 'Show View' -> 'Plug-ins'
You will find a list of all the plug-ins. Right-click on one, select 'Import as source project' and the source files will appear in a new project.
Note this works on Helios, it may be slightly different on other versions
The source code was not packaged with the version of eclipse that you were using, And Garrett Hall's suggestion was to download "Eclipse SDK Feature" from the "Eclipse Project Updates" site. "Eclipse SDK Feature" is nothing but source code with minimal eclipse. So the source would get downloaded and get installed and after a restart and an import of the plugin project, the plugin source code can be seen.
This is not universal- as in ,just downloading the Eclipse SDK feature would not be sufficient to see source code of any plugin(which did not include the sources).
If you want to understand the source code better, then I would suggest that you fetch it from SCM into your workspace. You can easily do that from the "Plugins" view: find the plugin you're interested in right and try right-click, "Import As" > "Project from Repository...". It should automatically clone the repository, checkout the right tag and import the source of the plugin.

JUnit Eclipse plugin source-code?

I'm looking into writing an Eclipse plugin for FlexUnit and was wondering where I could get the sources for the JUnit Eclipse plugin. I checked the JUnit sources at sourceforge but couldn't spot any code that looked like the plugin code.
Any idea where this code is available?
You can find it on Eclipse's repository:
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.pde.junit/
There are now git mirrors of the CVS repositories:
org.eclipse.jdt.junit: git://dev.eclipse.org/org.eclipse.jdt/org.eclipse.jdt.junit.git
org.eclipse.jdt.junit.core: git://dev.eclipse.org/org.eclipse.jdt/org.eclipse.jdt.junit.core.git
org.eclipse.jdt.junit.runtime: git://dev.eclipse.org/org.eclipse.jdt/org.eclipse.jdt.junit.runtime.git
org.eclipse.jdt.junit4.runtime: git://dev.eclipse.org/org.eclipse.jdt/org.eclipse.jdt.junit4.runtime.git
Since you are in all likelihood using Eclipse, there's a far easier way to import it right into your workspace. The source is bundled with your eclipse distribution.
Just do
File -> Import -> Plug-ins and Fragments
Keep defaults ("Active target platform", "Select from all plug-ins" & "Projects with source folders"
Hit next, and select the JUnit plugin-packages and hit Finish, and they will be imported as Eclipse projects into your workspace.