I have been using vscode with no problems until recently. Now no errors show up, some variables never change color. And I have a constant error message:
Project ... has no explicit encoding set
I have no idea what I need to do to fix it.
Just a few minutes earlier I was also having the same problem. Here is how I fixed it:
Click on the Gear Icon.
Click on Settings.
Click on Command Palette.
Type Clean java language server workspace.
Hit Restart and Delete.
After reloading is done, the issue will be fixed.
I believe this is a bug caused by v1.5.0 Red Hat's Language Support for Java extension. Nothing I tried fixed it, so the best solution may be to wait for the extension developers to fix it.
You can follow the issue on GitHub https://github.com/redhat-developer/vscode-java/issues/2416
Update 4/21/2022: Looks like it was caused by an upstream issue in the Eclipse JDT Language Server (which is used by the Visual Studio Code Java extension). Check the GitHub link above for details.
Update 5/13/2022: Upstream issue has finally been resolved and merged. Red Hat's Language Support for Java extension no longer has this bug for me as of v1.6.0.
I experienced the same problem after the Language Support for Java by Red Hat extension had been updated to v1.5.0. No code errors were reported and only the message about no explicit encoding was shown in the Problems tab.
I was able to resolve the issue by clicking the "..." next to "Java Projects" in the Explorer view, and selecting "Clean Workspace", then "Restart and delete".
After the application had reloaded, the issue was gone and language server started working as usual.
I have same problems before few minutes ago.
and I solved this problem.
File -> Save Workspace AS -> Choose Your directory -> Save
I used Eclipse Java last year for a class, and this year I have another class that's requiring us to use Eclipse C. I tried installing the Eclipse C/C++ packages, but when I write in Eclipse it stays in Java. Please help!!!
Also, I don't really want to uninstall Eclipse if I don't have to, because I'm still actively working on projects.
You've basically downloaded 2 "modes" in Eclipse: Java mode, and C/C++ mode. If you type and it assumes it's Java, that's because the project you created is in "Java mode".
First, just quit out of the app and open it again. Maybe the update only enacts when the app is refreshed.
Now go File > New. If it's installed correctly, when you hover over "New", there should be the option "C/C++ Project". If there isn't, double check that you downloaded the correct extension. (Note that I'm on a Mac so the layout might be slightly different for you, but it's the same idea).
IntelliJ IDEA 14.1.0 (Ultimate edition)
Java 1.8, 1.6
Scala 2.11
We are working on a project which has several modules most of them are Java and one of the modules is in scala.
For some odd reason IDE becomes non editable (i.e) I can't modify any files, though I can click and navigate between files.
Its so annoying that we've to restart the whole IDE or mutilple IDEs in case we have multiple projects opened on different IDE windows.
I have seen this, I think its due to accidentally changing the edit mode,
at the bottom right corner there is a small lock icon, if you click that it will toggle readonly and editable.
For me, it was the accidentally turned on Vim emulator (found the answer here). Untick Tools -> Vim Emulator.
Here's the image from the original thread:
I know this question has been asked before and I have seen a plethora of solutions out there, yet none seem to work for me. I was able to build my apk without issues until this error started cropping up. I have tried cleaning my project, removing it from the workspace and reimporting it, removing "Java Builder" from my Builders for the project, building the project manually, reordering my java build path. I have no visible compiler issues and no problems exist in my workspace.
I did experience this issue before and solved it once by removing the project form my workspace and re-importing it and another time I solved it by removing "Java Builder" from my java build path. None seem to work this time. I currently have most of the settings set back to default (i.e. java build is checked again).
I am running windows 7 (64 bit) and using jdk1.6.0_21 via Eclipse 3.6.
Any suggestions would be greatly appreciated as I have lost loads of development time troubleshooting this already.
[Update] My locale is English & I have tried removing the debug.keystore, United States as related to issue 834
Please follow these steps; this might help you out:
Right-click your app project and go to Properties
Select Android from left-hand side list
Uncheck the "Is Library" checkbox
If your app project relies on library projects which are in your workspace, those of course need to have the "Is Library" box checked.
deleting the R.Java file in /Gen folder did the trick for me
I tried all the above solutions. but it didn't work.
The solution was to restart eclipse !!!!!!!
hope this will help someone :)
In my case this problem started after eclipse updated the plugin with the v4.0 API release. I fixed it by going to the main preferences for Eclipse and under Android->Build uncheck 'Skip packaging and dexing until export or launch'
Note: if you eclipse gives you the Unknown Command 'crunch' error then follow this post
I've tried to gather the best of other peoples answers into a step by step list of things to try in order:
Check the project is not set as a library:
Go to Project->Properties
Select Android from left-hand side list
Uncheck the "Is Library" checkbox
Clean and rebuild the project - this should delete and recreate the entire gen folder, including the R.java file mentioned in some peoples answers
Check eclipse and all the Android plugins are up to date
Close the project, exit Eclipse, reopen eclipse, reopen the project.
Go to Java Build Path > Projects and check for any incorrect project dependencies
Go to the main preferences for Eclipse and under Android->Build uncheck 'Skip packaging and dexing until export or launch'
Check JAVA_HOME is set correctly. Follow the steps in this article
If you complete the above list, and still haven't solved the issue, please leave a comment, or if you find something else that works, feel free to edit the answer and add your thing in.
Delete the project from your workspace & import again.
This worked for me.
Can't believe similar issue has been there since 2008.
http://code.google.com/p/android/issues/detail?id=834.
i'm no expert, but eclipse on Windows, doing android apps, refuses to create the default.properties file (in the app root directory). I've just copied one from another app and it works fine. Simple contents, for Android 2.2 project it just says (ignoring comments):
target=android-8
fwiw
I was having the same issue as the OP except that all these suggestions did not work. I found a solution for me.
Make sure that "Skip packaging and dexing until export or launch." is selected.
Go to Window -> Preferences -> Android -> Build. Just make sure that option is selected and apply.
I know this does not make a lot of sense, but having it unselected was giving me this error and with it selected it goes away and the apk is installed.
I am using the auto generated ant build script from android and ONLY using it as my build process in eclipse. I am not using any other build methods.
I figured it out. I was referencing JavaSE-1.5 and using JDK 1.6. I changed it to use 1.6 and that appears to fix it.
Seems like through my research that is an overloaded error message that covers a lot of error cases.
I just fixed this by reselecting a default JRE for the execution environment (JRE6 for JavaSE-1.6 in my case). It got unchecked for some reason.
This fixed my problem. I kept getting the console error in eclipse "Could not find com_android_vending_licensing.apk" and even though it didnt seem to effect the way my app ran, it was annoying. So going into the com_android_vending_licensing project properties and unchecking the "is library" option, building the project to produce the needed apk and then going back into the com_android_vending_licensing project properties and re checking the "is library" check box fixed the problem.
Run Eclipse as "Administrator" and then import the project.
None of these things worked for me. I'm trying to access native code through the jni, first with NDK samples. What I found was the build won't run if jarlist.cache is not present in the project bin directory. If I copy one from another project to that location (may need to refresh to see the folder in Eclipse), build works every time.
Clean the project and it will do. Sometimes it happens unknowingly but keep trying to solve using diff methods.
I had somehow done a Run configuration as a Java application instead of a Android.
the problem for me was I was trying to use IBM RAD which appears to not work properly for this, I installed Eclipse and now have a different error but I should be able to get past it
On my machine (Windows7, 64bit) I could fix this by setting my execution environment to a 32bit variant of the jdk (I used 1.6.0_23). And I tried a lot of things before...
SHA1's answer did it for me: after updating to the latest sdk/adt, my project refused to build an apk; unchecking the option resolved the issue.
I don't know if the update checked this, or if it was checked before but the new adt screwed things up, but things work again now :)
In my case this worked :
Delete R.Java file in /Gen folder
+
Delete all "R.Android" imports that Eclipse added to some of my java classes !!!
and rebuild the project.
remove -- R.java -- Clean the project and run again.. this worked for me ..
Find the project's folder in your system, enter it's Properties via context menu and deselect "Read only" option. Worked in my case.
This seems to be the source of the problem in many cases, moreover some solutions up there base on copying/rewriting the files in the project what makes them non-read-only.
This is caused by JAVA_HOME not being set correctly. It can be easily resolved by following the steps in this article.
Mine was caused by this problem (incompatibility between ADT and SDK), and was fixed thus:
Eclipse > Help
Install New Software
Add 'https://dl-ssl.google.com/android/eclipse/' to 'Work With'
section and press enter
After developer tools appears on the list, check it and click Next
Restart eclipse once download is finished
I my case, I had to switch from API 21 to API 19, clean and build and everything was fine again. I am using a Mac and apparently API 21 is not fully supported on Yosemite.
I have been using eclipse indigo happily for android development for a while. In the last few days it has stopped refactoring. I have tried a project clean and of course restarting eclipse.
I have also tried renaming the org.eclipse.core.resources directory as suggested here: -
http://letsgetdugg.com/2009/04/19/recovering-a-corrupt-eclipse-workspace/
Any ideas what I could do? Thanks!
I get this occasionally. It usually happens when you install (or update) and plugin and that plugin has a key binding the same as alt-shift-m (or cmd-alt-m on OSX). You need to go into your eclipse preferences and change the key bindings.
Under preferences go to General -> Keys. Then search for the shortcut in the bindings field. You will need to delete the binding and add your preferred one back in.
It has now randomly started working again. If I find the reason I'll post it here for googlers!