Unable to launch java application in eclipse after mercurial clone - eclipse

I guess this is a Eclipse question.
I have a mercurial repository with a source folder (src/main/java/) and some source code. The repository also contains a build.xml. After cloning the project into Eclipse using the Mercurial plugin I'm unable to configure a launch configuration for my project. Eclipse is unable to identify the newly cloned project as a project when setting up the launch configuration. What am I missing?
TIA

What kind of launch configuration are you using?
an External Tools Configuration (in which case you defnie and Ant Build with a direct link to your build.xml)
or a "Run Configuration", meaning your repository must include a .eclipse and a .classpath for eclipse to list your project as one being able to Run.
As discussed before in Which eclipse files belong under Version Control, those two files can be versioned, provided they only use relative path.

Do you have a .project file?
If you do, you should be able to use File->Import->General->Existing Projects into Workspace.
If you don't, try File->New->Project and there are various different options to create a project from existing source.

Related

FindBugs plugin does not work on projects imported from GitHub

I have always used FindBugs, and it is really useful in many cases. But I couldn't get to find why it does not work on projects imported from GitHub. Projects imported into Eclipse using Git as the source does not have an option to run FindBugs.
Does anyone know why, and a solution to this? I do love to use git extensions on Eclipse, as well as FindBugs.
Is the project that you imported from Git recognised as a Java project (i.e. it has a J under the project folder icon)? If not then FindBugs won't be enabled for the project. If that's the case the remote repository almost certainly hasn't added the .project and .classpath files which are what Eclipse uses to determine if it's a Java project or not.
You should be able to convert it to a Java project by right-clicking and doing 'Configure -> Convert to Java Project'. If that doesn't work, delete the project (but without deleting the files) and then create a File -> New Java project in the same location.

eclipse intellij can use Github for same project

Is it possible to create one project in GitHub, and two teams who are using different IDE like Eclipse and Intellij can configure project with github and can work simultaneously on same project?
I have searched it but not able to find proper solution for it.
Yes, you even can version:
your .project and .classpath (eclipse)
and your .idea folder (intellij)
And both set of IDE-specific files would ignore each others: one could use the Eclipse settings without realizing there is an IntelliJ IDEA project, and vice-versa.
Yes this is possible.
Most IDE's do create some specific project folders, where the IDE does store Data for your project. As example local build paths and so on.
Git provides the .gitignore file.
In this file you can specify which folders and files git will ignore. As example IDE Based files and folders. Due that every developer can his favourite IDE and no local IDE based files will be in the Git Porject itself.
Most IDE's will update or crate the .gitignore File automatic when they do find an git folder in the project.
What files you have to add to the .gitignore file is differs from IDE to IDE. It also depends on what Programm language your Project is written in.
Here you can find more about the gitignore file:
How do I ignore files in a directory in Git?
http://www.bmchild.com/2012/06/git-ignore-for-java-eclipse-project.html
Yes you can, there no limits on IDEs and number of team members, check this for Eclipse
and this for IntelliJ

Subclipse checking out as folder not Java project

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

Make Eclipse reference maven projects and not jars

I'm trying to have the projects within my workspace to reference each other directly, instead of the jar files from the maven repo. That used to work perfectly fine when having all the projects in the same folder (eclipse workspace) and using mvn install and mvn eclipse:eclipse. However, now it's not working and I believe it's due to the fact that the projects are not located in the workspace folder, but in my local GIT repo, from where I import them into Eclipse. I assume that I need to set some variable somewhere, but couldn't find anything on this on the interwebs. I've also tried using the eclipse maven plugin, but I got into other problems that completely broke my setup. Using -Declipse.useProjectReferences=true doesn't help either. I'm grateful for any hint!
I suddenly began having this problem after a reboot (??).
What worked for me was:
on my project's context menu, open "Properties"
Java Build Path tab: add the projects which need to be referenced
Order and Export tab: move these projects to the top of the list
There's a setting on each Project to control this behavior. Right-click to open the project Properties, then select the Maven section; there you'll find the option Resolve dependencies from Workspace projects.

eclipse - building projects dependent on jars - created during ant

I am experiencing a problem with Eclipse's building its projects.
The procedure for setting a dev env is:
Creating a clearcase view.
Opening eclipse.
Importing preferences.
Connecting to clearcase plugin.
Importing a team-set.
Running ant - build.xml
During the build.xml, some files are generated and moved from its working directory into the some projects' lib directories.
After that, there are some eclipse.referesh task and eclipse.incrementalBuild that the build.xml invokes.
Now, the projects the jars (generated during build.xml) were copied into, do get compiled successfully, but other projects depending on them do not.
Even if I try refreshing the entire workspace and clean-building all of its projects manually, this doesn't work.
The problem is resolved only when I close the projects and open them (an eclipse feature).
It is possible that this is happening due to the ClearCase plugin?
Anyway on how to resolve this problem (It causes the build.xml to fail, because of compiler problems)?
With the official IBM ClearCase Eclipse plugin (presented in "What Clearcase eclipse-plugin to use in order to work on both clearcase 6 and 7 projects?"), I don't have that kind of issue if:
the .project and .classpath are within the ClearCase view, alongside the versioned sources
(see "Clearcase plugin for eclipse usage")
In other words, all files (eclipse files, ant files, ...) should be parth of the project directory, outside of the eclipse workspace itself (said eclipse workspace contains only a reference to the project, none of the actual files part of a ClearCase views, and located elsewhere, where the CC view actually is)
If you respect that organization, then the ClearCase plugin should have 0 effect on what your project are doing.