Google Eclipse plugin recompile problem - java

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.

Related

Java project from existing ant build file doesn't appear as in version control

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.

Eclipse Warning: Unknown Faceted Project

I have a parent Maven project (using java facet version 1.7) which includes some modules. I got the following warning from Eclipse Juno SR1:
Implementation of project facet java could not be found.
Functionality will be limited (Unknown Faceted Project Problem)
How can I get rid of this error? Quick fix didn't found anything. Interestingly, I do not have Project Facet entry in the Project properties dialog.
This occurs when you upgrade your IDE or open a project from older IDE into a new one.
To solve (remove the unsupported facet):
open your project folder;
goto to .settings sub-folder
edit the org.eclipse.wst.common.project.facet.core.xml file
remove the installed facet that refers to your error
if it doesn't solve immediately (if you edit the file right in Eclipse), try to close and reopen project or restart eclipse.
After all done, you may, if not done yet, mark the correct facet to your project to work.
Just delete the file
org.eclipse.wst.common.project.facet.core.xml
in the .settings folder.
It worked for me .
I think you can check your project properties. and then click the Project Facets. then show the dialog box. in dialog box u can check your project is mark to java.
in dynamic app, mark the dynamic web module, java, javascript.
I had this problem.
I found the Eclipse project was set to use JDK1.5 and I only had Java 1.6 installed.
After changing the version to 1.6, the offending warning disappeared.
I tried all the other answers at the time of this answer, and deleting the project (not the data) and re-importing was the only way to fix the issue for me.

Eclipse is not showing compilation errors in project explorer

I am using Eclipse Juno with Java 1.7 and i have created a test project. Now the problem is with project explorer. Project explorer is not showing compilation errors if class have any error.
I cleaned, closed , and rebuild the project but nothing is changed. It is still not showing errors in project explorer.It was working fine with Helios.
As I can see in your project explorer there is a RED exclamation mark over your project name which means there is a problem with the build path in your project. See here for more details.
Check the Build Path of the project by right-clicking the project and selecting Build Path -> Configure Build Path.
One problem I often encountered is different people using different Java SDK and so when the exact SDK is not available on your machine, you need to change to your Java SDK (via JRE System Library -> Alternate JRE). A better way to avoid this problem is to always select the JRE System Library from Workspace default JRE or Execution Environment.
Have you checked Project/Build Automatically?
I had the same problem. I checked the .classpath file of the Eclipse project. It had incorrect value of src so it was pointing to the wrong source of Java files.
My file's incorrect entry:
<classpathentry kind="src" path="src"/>
I changed it to the correct entry:
<classpathentry kind="src" path="source/java"/>
Now, its working :)
You can restore the errors to the package explorer by right clicking on an error in the problems pane and selecting show in and then select package explorer.
Set your build path and java compiler:
Steps:
Right click on the project and go to the properties.
Go to the java build path and set the jre version to the jdk5 or more. (which ever you have to your system).
Go to the java compiler and set java version to the compatible with jre (which ever you set in java build path).
After refreshing the project you may get the compilation error.
Set your Errors/Warnings:
Steps:
1) Right click on the project and go to the properties.
2) Select Java Compiler -> Errors/Warnings.
3) Check the "Enable project specific settings"
In eclipse you can right-click on a project and go Maven-->Update Maven
Project and this will tell eclipse to update all of its local project
settings (e.g. source and build paths) based upon the current pom.xml.
You must check the build Path configuration to point for the appropriate /src sources java folders, perform a clean up of the eclipse project as well as a maven clean.
I had the same issue.
I have faced similar kind of problem in Eclipse Photon.
I have cleaned, updated and build the project but nothing was working. Then I figured out that I have disabled problem reporting in preferences.
Here is what I did to resolve the issue :
Preferences-->>Editor--> Checked report problems as you type checkbox
Go to the eclipse project -> check the Build Automatically. It will solve the problem. I had the same issue and resolved like this.
Check your class package, it should be under src/main/java, if package differs from that, the compiler will not be able to read class and will not show compilation errors.
I had created a nested project and imported it by doing a refresh, but to get it to be acknowledged as a project that needed to be compiled, I had to also import it as a project:
Then, I also had to double click on one of the compilation errors in the "Problems" window to get the errors to also be highlighted in the source code file itself:
I had AspectJ enabled on my project, and that was the source of the issue.
So:
Right click on my project, AspectJ Tools, Remove AspectJ Compatibility. Then add it again with Right click and then Configuration and AspectJ

Netbeans compiles fine but show errors in editor

Netbeans is not importing a jar from another project. The classpath is fine, the project compiles fine but the editor show several errors in project because it cannot locate classes inside that jar. I've already rebuilded the projects and clean Netbeans' cache (~/.netbeans/7.1.1/var/cache/)
Netbeans version: 7.1.1 and also 7.0
OS version: MacOS 10.7.3
The problem lies with the Netbeans' code editor. My project compiles and it's packaged just fine. I have no problem on that. I have this annoying error messages (eg. red background) in the code editor with no reason.
A workaround I just found: Renaming the dependency project (with refactoring) and adding the new jar to my project do the trick. Still I don't know what happened.
I just had the same problem in NetBeans 7.2.1 today. I could build the project fine but got error markers in the source files and in the Projects tree listings. It seems as if the compiler when you build a project uses a different classpath from the compiler that works in the edit window.
In my case I found we had the same package and class names for different classes in different jars. I don't know if this is relevant or just a red herring.
I still had an error in one project that used these two jars. It seemed like it could only see the classes from the second jar listed in the pom.xml file (we use Maven). I commented out the second jar & rebuilt, then uncommented that second jar & rebuilt and suddenly all of my errors went away.
So I don't have a definite solution but removing and reintroducing a dependency worked for me.
How you import jar file ? You have to right click Libralies in Project Panel and click Add JAR/Folder. And select jar file which you want to import.
I think you have wrongly imported the jar file. Try out the below steps to add jar(s) to your classpath properly.
1. Select your project from the Projects explorer.
2. Right click -> Properties.
3. Select Libraries from Categories list.
4. Click on Add JAR/Folder button.
5. Add your jar(s) & click on OK to finish the process.
Now, it should resolve the reference issues
You mentioned, the editor shows errors because it cannot locate classes inside that jar. Well, are you sure you are using the right jar or right version of jar ? Eclipse is not able to locate any of the classes or only few classes ?
I wish my answer would help fixing the issue (even if too late :) )
Indeed, I have a maven project with two modules. Module1 that contains the class com.x.y.MyClass and Module2 where I'm trying to import com.x.y.MyClass.
It compiles fine, and I can run unit tests using netbeans, but the errors in the editor were embarrassing. So I add Module1 version and packaging type to the pom.xml of Module2 and that fixed my problem (I know, it's very bad to hard code a module version, but at least, I can work without worrying about the editor list of errors)
Cheers !
This is definitely too little too late, but I had this problem today with Netbeans 7.2. All jars were in place, the code was compiling from the build menu, but Netbeans was marking the files in error.
The same exact project was compiling fine with Netbeans 8.0.1.
The problem was with the "Source Root". I clicked on menu Window -> Debugging -> Sources (Alt+Shift+8) and I noticed that I had specified sources on some of the jar dependencies of the project that were no longer valid. Cleaning them up was a 2 step process:
Clean them up from the project files in nbproject dir
Clean them up from
%APPDATA%\NetBeans\7.2\config\Preferences\org\netbeans\modules\java\j2seplatform\Sources.properties
After clean up, I restarted Netbeans and everything was OK.
Hope this helps someone.
I had this issue with few jsf xhtml pages though there wasn't any error in the content of the page. So I opened each page and cut all content, saved the empty file then paste back all content and saved it. it solved the red marking error symbol for me.
I know this question is a bit old but for those who may be facing the same issue currently, hope this will help.
I faced the same challenge after moving my maven projects to a new directory. To fix the issue, I just simply
Renamed the new folder(the one containing my maven projects) just the same name as the previous folder.
Reimported the projects in Netbeans.

Android Eclipse Classpath - want to add classpath container path but eclipse won't let me

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?

Categories

Resources