add raw to res dir - java

I know this is a well-known problem
but I did every possible thing:
cleaned the project
re-build
remove the project and add again.
but still.
the R file does not updated
what do you suggest me to do?
thanks
socksocket

Make sure that you have chosen the appropriate target build settings from the project properties
Cross-check the platform versions with the layouts you have used in your app
Remove import statements such as import android.R.*;

OK. found the solution
I had sub-directory inside "raw" directory and I think it is forbidden for some reason
I moved the mp3 files to "raw" dir and removed the sub-dir called "sounds"
and now it works!
cheers!

Related

The import cannot be resolved in JSP

Before posting this message I read tens of threads but with no success. I am trying to import a package into one of my JSP files and I keep getting the same error:
The import cannot be resolved.
I believe that something is not right with my project structure. I have tried everything, from cleanup, rebuild, even creating another project from scratch.
This is the structure of my project:
And these are the contents of my build path:
I would greatly appreciate any kind of help, this is a big blocker right now for me.
Yes, it's your project structure. Your source files are not actually under the src folder that would be listed on the Source tab of the Java Build Path property page you're showing (you can see how it's laid out that folder's contents to resemble package names). Either move the files to where they're expected or update the Source tab to point to where you're actually keeping them.
add the Java Resources/src folder to the build path or the library build path.
Thanks a lot for your answers, I have changed the project structure like in the image below and now it works:

Eclipse not recognizing class after import of jar file

I have tried creating new projects. Removing and adding the jar file. Nothing is getting this thing to recognize it. I don't know if I am adding this correctly or not. Could someone please direct me, thanks.
EDIT: After some research using the help from the comments, it seems the problem is that the jar file only works if I am using a default package. I obviously don't want to use the default package so how can I change the Jar to fix this?
I don't know if this is a workaround or fix. I had to exclude the folders from my build path to use the jar file that had a default package. I did figure out how to deconstruct/reconstruct but for future reasons, I would not want to do this everytime someone hands me a file using the default pkg. So here is a screenshot of a working setup:
Please click it if it is not big enough for you. The summ/wint folders are excluded and I am able to use a class from the jar file without editing the jar file.
Money dd = new Dollar();
Thanks for all the comments.

Importing google-play-service library, appear "No projects are found to import"

I tried importing google-play-service library, but it shows me the message below.
It's the Path:
IT's the message:
What did I do wrong?!?
Hey,Try this way,hope this will help you to solve your problem
Copy your google play service from eclipse and paste in same derive of your system where you create project, then check.
if it not work then create new workspace and check. sometime it make app by default and said there is no project.
Checkout and tell me if it work or not
You just Import the project Sdk/extras/google/google_play_sevices/libproject/google_play_services_ib/
dont go beyond this path, just imort this whle projest.
Note: While importing or attaching lib project with your project then take care of one thing:
If path appear on import starts with a drive letter(C:, D: etc) then ,it means import not successful, it should be start with dot (...)
The library project should be on same location where your project is (for successfull import.) while it is in workspace on at any other location.
try to paste it in directly in your workspace and if you simply wants to add jar files then use buildpath option for particuler project.

BlueJ Importing custom class library

Ok the deal is, I've made a small class library (*.Jar file) to help make a more visually organized code and to help with some common tasks.
Before you tell me to go to: Tools > Preferences > Libraries.
I have done that, over and over and over again.. I also tried to manually add it to: C:\Program Files\BlueJ\lib\userlib\"jar file here"
And yes, i did restart BlueJ to load the newly added libraries.
No matter what i seem to try it won't let me import it to my project using the import command, but without it, it just won't compile.
I know i can just add the classes manually, but as the class library slowly grow, so does the effort of adding all the classes in that library.
In advance, thanks for your help and consideration.
If adding your jar file in the Preferences > Libraries tab doesn't work, you can try adding the jar to the "userlib" directory at <bluej-dir>/lib/userlib (where <bluej-dir> is the folder where BlueJ was installed).
A third option you can try is adding your jar file directly to a project by creating a +libs directory inside your project directory and copying the jar to that directory. This has the drawback that you have to manually copy the jar to each project +libs subfolder that needs your library. On the plus side, it allows you to distribute your project (library jars included) just by zipping up the root project directory.
On Windows I create directory named "+libs" on my blueJ project directory,
then add .jar to that directory, and restart blueJ ,
that´s help me, and import after that work fine
Despite the post's oldness for who stumble upon i can say with the newest version of BlueJ (actually 4.1.3) in an old Ubuntu distro(Lucid Lynx aka 10.04LTS) all work as intended per default without any hack

In eclipse, is it possible to change what the default package is without changing the source folder?

I'm working with some people on a java project. Problem is, I'm the only one using eclipse. The source files are located in svn in trunk/src/*.java. However, if I import that as a project directory, the default package is "" instead of what the actual project package name is.
Is there a way to change that without changing the source location and the package name?
Thanks!
If you mean that you want code in package foo.bar without having a matching directory folder of foo/bar under some source root - no, I don't think Eclipse supports that. While the convention of source locations having to match package structure isn't enforced by the language specification, it's mentioned there and so widely respected that I think it would be a bad idea to do anything else.
Eclipse requires a directory structure that matches the package structure. There is no option to have some package prefix that isn't reflected in directories.
IntelliJ can work with this, and it's what most people expect to see most of the time anway.
I think you are checking out the incorrect root folder.
If you are trying to work with a collection of source files located under trunk/src/ you may be don't need to check out this folder, because you will loose your reference to the main package (for example foo.bar) because it will be the base package.
You may need to check out the trunk/ folder, because Eclipse expects to find the source files under the default /src folder. Once you have your main root folder (with a lot of files like .project, .classpath inside), it is likely possible that Eclipse will recognize your folder structure and configuration and your project will compile without problems.

Categories