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.
Related
I'm trying to import a Java project from my teams subversion repository. So I go through the import GUI for subversion, select my repository and the project, then choose to check it out as a project into the workspace.
However, the project now appears in my workspace simply as a folder:
Trying to add a new class tells me "source folder is not a java project". Is there something I am missing? Thanks.
Check out as a project only does what you want if you have checked-in the Eclipse .project, .classpath files etc. In that scenario those files get checked out and configure the Eclipse project. Otherwise you are just getting an Eclipse "Simple Project" which does not have the Java tools configured.
I assume you do not have those Eclipse files in your repository, so you want to use the other option that lets you run the Eclipse Create Project wizard as part of the checkout. This lets you choose the project type and setup some of the configuration. You can skip most of the configuration since you can also do that after the checkout finishes if you prefer.
See: Subclipse Checkout Documentation
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.
I am struggling with maven in Eclipse even though I have m2e.
I checked out a maven project from CVS and cannot navigate anywhere. If I try References > Project, I get a pop up saying:
"Problems opening an editor Reason: services does not exist".
services is the name of the main project, which has sub projects within it. It all builds successfully so I am not sure why Eclipse does not work.
I suspect something related to classpath but have no idea how to edit it since it is not available from the project's properties. I actually tried to manually create a .classpath file but it did not help.
I also converted the project to a maven project but that did not help either.
Any ideas? I am using Eclipse JUNO.
I figured out my issue. I had to check out the project from CVS. Then (that's the important part), perform a maven import of an existing project within eclipse. That created maven "ready" projects where I could use all of the IDE's functionality.
Yes, you're right. If you import directly from a repository, hovering, linking and opening declarations isn't gonna work. Your solution is right, although another one more direct is use the "File->New->Other->Maven->Checkout Maven Projects from SCM". If then, you have problems because you can't select any SCM type, check Checkout Maven project from SCM - no connectors. If with connectors installed you still have problems: http://forum.springsource.org/showthread.php?102665-SCM-types-not-available-in-Checkout-Maven-Projects-from-SCM.
If you have checked out project from svn, project checked out is not generally a eclipse project thats why general functionality of eclipse does not work for the same.
To achieve the same functionality of eclipse like eclipse reader and all other shortcuts,we have to convert the checked out project to eclipse project.
Steps to Convert checked out project to eclipse project:
Right Click on Checked-out Project.
Point to Configure.
Click on Convert to Maven Project.(if checked out project is maven project)
These steps will convert the project to Maven project.
All the eclipse functionality will work for the same.
In addition to ensuring that the projects are configured as Maven projects, you may also go to Project Properties (right-click on the project in Package explorer) > Project References, and add projects in the workspace that the selected project may have references to.
I had this problem, too.
It looks like after a search-in-workspace Eclipse opened a wrong file.
I pressed Strl+Shift+H (Open Type in Hierarchy), typed in the class name, and opened it. The file opened in a new tab, and everything was navigable again.
The difference in icons is:
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.
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.