I am maintaining a java program that is not mine. I used eclipse and I could build the program with Ant. I don't know very much about Ant. Everything was installed fine on my eclipse IDE and the build worked perfect till today. I didn't change anything, so I don't know why it doesn't work anymore.
When I look at the external Tools Configurations,I see that the targets are missing. I have the message "No targets could be determined for the build file". Previously I could select some targets. Does someone know how it come that the targets disappeared?
I fixed it by switching the eclipse workspace. I went to menu File->Switch Workspace->Other, and then I have selected the same workspace I was working with. Eclipse restarted and the error wasn't there anymore.
This helped for me:
remove the build file from Ant view and add it again.
Related
I added JDK and Ant to Enviroment System variables but that doesn't stop a simple Ant build in IntelliJ from breaking. I have set the system path variable to accept both Ant's directory and the JDK enviroment. I have created JAVA_HOME and Java is still functioning in the cmd.
There isn't any code in the project. There is just this build that generates this default code.
I haven't altered anything once I started the build and if I go into Project Structure -> Project Settings, I have the Project SDK set to 1.8.
What is going on here?
**EDIT: I managed to remove a lot of the errors by toggling a box to Generate the Ant Build to Use current IDEA instane for idea.home property. **
It looks like many properties from test3.xml are not available/defined in module_test3.xml. Did you already try to do a "Generate single-file ant build" (the second radio button in the "Generate Ant Build" dialog)? This could be a way to avoid the problem of Ant properties from one build file not being available in another build file.
Are you very attached to Ant for building your projects? You could give Gradle and/or Maven a try, to see if these tools work better for you.
If you are doing Android development, you could also check out Android Studio. If you are using IntelliJ IDEA, I would definitively consider upgrading to version 15; the community edition is free and version 10.5 is around four years old now.
I have a repository in which I have a simple ant project (only the src directory and the build.xml file). I did a checkout of this project in a local copy. Then I opened Eclipse, created a "Java Project from existing Ant build file" and it worked fine. I can build, clean, run, generate javadocs, etc. However, my problem is that the source files in the packages, as well as the project itself, doesn't appear to be under version control in Eclipse. I can work with it fine from Cygwin, but not from the GUI.
The odd thing is that I have several regular Java projects, on the same repository which are synced fine by Eclipse, so it's not a version issue.
When I created the projects that work, I had to go to Team->Share Project... and Eclipse told me that they were already under version control and updated its configuration. However, in this current case, this isn't working. Any suggestion please?
EDIT:
I'm using svn 1.8.
UPDATE: I tried creating a regular Java project, and this time the version control looks fine, so it appears it's an issue related only to Java Project from Existing Ant build file.
The problem is that Eclipse doesn't know your project is using Subversion as a version control tool. You did a checkout outside of Eclipse, then you set up Eclipse as if this was a non-version controlled project.
To get Eclipse to recognize the project as under Subversion, you need to let Eclipse know. This means you should have said "File->New->Project, and select SVN->Checkout Project from SVN in the new project wizard. Then, Eclipse would have checked the project out in Subversion for you, and Eclipse would understand this project is in Subversion.
Unfortunately, I am not quite familiar enough with Eclipse to know how to tell Eclipse that the current project is really under version control. The best I could come up with was:
Right-click on the project and select Team->Share
Say this is a Subversion project you want to share.
Select the Repository to use
Select the folder where you want this project, and select the current folder.
You get the following warning:
Warning: The specified folder already exists in the repository. If you continue, that folder will be checked out to the existing location. Do you want to continue?
Your project will now be "checked out" over your current project. Everything should be okay because the files you have either match what is in Subversion or are modified versions of what is in Subversion.
You will be then asked to use the Synchronized view. Check "Yes", and then switch back to the Java view. Eclipse will now know your project is under Subversion and everything should work fine.
Note the use of Shoulds and Coulds. This is my way of saying that the advise given is done on an "as is" basis and I am not responsible for any damage done by following this advice, so please don't sue me.
It's basically your standard open source license.
I am noticing a strange issue with Eclipse Indigo. It is Building Workspace again and again even though there is no change in the code!
In Progress bar it prints
Building Workspace 44%
..
Building Workspace 10%
..
Building Workspace 33%
Any idea what is going on here? For the time being I have unchecked the 'Build Automatically' flag.
I have tried the following trick couple of times and this seems to work more often than not:
Uncheck Build Automatically flag
Refresh all the projects in the workspace
Re-enable the automatic build after sometime by checking the Build Automatically flag
Note that as I mentioned earlier this is a trick and not a resolution. But, hope others facing these issues will find this helpful.
Yes, I have noticed that too and it can be rather annoying. I have reverted to manual compiling in Eclipse by switching auto-building off (under project).
Compiling manually is a bit old-school, but it works for me. I prefer to compile, package and test the code at the command line using maven.
(I'll probably get a downvote for this approach (i.e. not using integrated tools, etc.), but it works for me and it works well! At least I'm not using VIM for coding Java! :))
If you are using Windows 7, then the Windows indexing in some directories can cause automatic rebuilds in Eclipse: see Bug 342931 - Windows 7 Libraries trigger rebuilds.
I have installed Eclipse Helios(3.6) and Google plugin to develope app in GAE/J.Then created project and runned it sucessufull. Later made some changes in source code but it doesnt recompiled. Previous compiled version is in use. It doesnt compile until I make changes in appengine-web.xml. Could you suggest how to solve the problem please?
PS : I had the same problem in Eclipse 3.5. Also I added javac to SYSTEMPATH.
You could try the following:
the folder where your java files are in is a "source folder" (check it via project properties, "build path")
turn on "build automatically"? Can be found in Menu "Project"
Maybe refreshing your workspace automatically will help (Window->Preferences, and search for workspace)
The Project is automatically not builded or recompiled, when there are problems marked by eclipse. Take a look into the marker panel of eclipse and solve the problems.
I'm using Eclipse to learn to develop Android applications in Java. I haven't used Eclipse before.
The project I'm trying to use (supplied by OReilly as part of 'Android Application Development') is MJAndroid. When attempting to run the project, the Run fails, and the Problems tab mentions com.java.Object can't be found, and Eclipse asks me to check the build path. Clicking
Properties -> Java Build Path -> Libraries, the message 'Unable to get system library for the project' is displayed.
On a working project, Properties -> Java Build Path -> Libraries has an entry for Android 1.1, which if I click Edit, has the classpath container path of com.android.ide.eclipse.adt.ANDROID_FRAMEWORK.
It seems a simple matter of adding the correct container path to my non-working project. However Eclipse seems determined to make this as difficult as possible. No matter what I chose to add - jars, externals jars, variables, libraries, class folders, external class folders, nothing seems to take the form of 'com.android.ide.eclipse.adt.ANDROID_FRAMEWORK' that the 'Android 1.1' entry on the working app has.
How can I add this namespace to my project so it resembles the working one?
I'm quite sure it's a problem with Eclipse's somewhat odd user interface. Frankly there' nothing I'd prefer more than a file to modify and set such information - my background is in Python, and the whole eclipse environment seems an unnecessary burden.
I had faced the same issue when I imported a sample code downloaded from the internet. I am using android sdk 1.5 with 0.9 ADT plugins. Here is a simpler way to fix the andoid library reference issues
Right click on the project which has
issues and select properties
Select the appropriate Android build
(1.1, 1.5 or 1.5 with google api) and
say ok
Again right click on the project and
select "Android Tools > Fix Project
Properties"
Fix the imports once (if required)
Refresh the project and you should be
ready to go without any manual
editing
I faced this same problem after importing a project through GIT. The problem was that I didn't have the same target android platform installed, and the build path somehow got corrupted.
The first obvious thing i did was changing the target sdk in the project.properties, but even after cleaning up the project and Android Tools > Fix Project Properties, it didn't help and I was still getting the build error.
My solution after wasting close to 1 hour trying to figure this out?
RESTART ECLIPSE
Everything worked fine after that. Eclipse is pretty fickle. Only through years of experience you'll then understand her well. :)
Had the same problem and it turns out the Android SDK Location was not set which was a really simple fix. Go to Window->Preferences, click on 'Android' on the left hand menu, fill in the location of the Android SDK (e.g. C:\Program Files\Android\android-sdk) and click OK. Everything worked fine for me after that.
Found the answer in this set up guide: http://developer.motorola.com/docstools/library/Installing-Android-Dev-Environment/
Sometimes Eclipse can get a bit funny (technical term) with classpath container resolution.
You have a working project in your workspace, so you can rule out plugin installation issues. You could try opening the .classpath file (hidden by default, select the triangle in the top-right of the Package Explorer view, select Filters... and uncheck .* resources) and manually adding the container declaration.
`<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>`
You may then have to close the project and open it again (right-click->Close Project) before Eclipse recognises the change.
You may also find that there is an Android builder and/or nature. If you compare the .project files for the working and non-working versions you may see entries for Android builders/natures. Copying the relevant entries may resolve the issue.
sometimes, eclipse can help you.
In Android projects, click right button on the project-> Android Tools -> Fix Project Properties.
It's usefull in class path errors!!
Luck!
I would verify you have the correct version of Java installed as well as the Android SDK. I would recommend installing/reinstalling the ADT plugin in your eclipse, makes it alot easier to create the android project.
http://developer.android.com/sdk/1.5_r2/installing.html
Also. I guess the path of the Android SDK must be setup correctly. This happened when I was overloaded with projects and I decided to create a new workspace copying some existing stuff into it.
Seems that the new workspace requires you to setup these details too once again
Is that setup properly?