Box2dLights on libGDX android project - java

I tried to import the jars of Box2dLights to my project in libgdx, I configure the Buildpath and errors always happen.
Where I need to put the jars? Someone know please?
thanks : )

Right-click into your core libGDX project, Build Path > Configure Built Path...
Select the Libraries tab, Add JARs... and choose box2dlights.jar you've downloaded. Then on the same tab select it and click on the Source attachment. Click on Edit... and browse your box2dlights-sources.jar
//important part
Now, right-click on your libGDX android project, Build Path > Configure Built Path... and do the same as later, but choose your box2dlights.jar located in your core project.
Go on Order and Export tab, check your box2dlights.jar, and move it up, below your gdx-backend-android.jar
still trying to improve my english,
Hope it works!

It doesn't matter.
Put the Jar in the libs's folder of your android project
When you configure the Buildpath, in the Order and export, don't forget to check the box2dlights.jar
By the way, if you still got errors, you should tell us what are them.

Related

How to reference a java project in my android project?

I am making an android app. I have created a java project also that uses BufferedImage to manipulate images. I want to use this project in my android project. How can I do that?
I'm using eclipse. When I right click my android project > properties > android > [add]
my java project isn't in the available options. I think I need to somehow mark it as library.
Does anyone know how I can do this?
Thanks
Add your Java project to your build path:
Right click on your Android project, click on Properties. In the dialog, select Java Build Path, and then click on the Projects tab. There, add your Java project to the build path.
make JAR of your BufferedImage project and then copy it inside your new project, then right click on the JAR in Eclipse and Choose Build Path -> Add to classpath or something like that

Eclipse ADT appcompat... what is it?

I've spent all afternoon getting absolutely nowhere with this.
I've downloaded Eclipse, downloaded the SDK, installed the updates, but every new Android project I create something's wrong.
Firstly, it would not generate the R.java file, at all, now it does but there's a separate project it's created automatically called appcompat_v7. I don't know what this is, but it's causing problems with any other new project.
This is the error a normal project produces:
The container 'Android Dependencies' references non existing library '/home/omar/workspace/appcompat_v7/bin/appcompat_v7.jar'
I have absolutely no idea how to fix this. What is causing this?
EDIT
It appear this is only with KitKat, every other API platform doesn't produce ANY source files at all.... any idea how to combat this?
It's a support library which presumably your project refers to. You will need to build it as a library project in your workspace. This process is described here Support Library Setup under Adding libraries with resources.
You will find the project you need to copy in your SDK in the folder:
\yourSDKlocation\tools\android-sdk-windows4.4\extras\android\support\v7\appcompat
(It's no use just copying a jar, you must build it as a library project.)
I had this problem when I moved a project to a different laptop. I solved it like this:
If appcompat_v7 is not available in Eclipse:
From the File menu, choose New then Project.
Next, choose Android and Android Project from existing Code, then click next
Browse to find your appcompat_v7 project folder
Make sure there’s a check mark next it in the ‘Projects to Import’ list
If the appcompat_v7 project folder is not currently in your workspace, select ‘Copy projects into workspace’, then click Finish
Now that the library project is available in your workspace, it can be added to a project:
Choose your project from the Project Explorer and open the project properties (on a mac it’s in the Project menu)
Click on Android in the left list
Next to the Library list, click the Add button
Choose appcompat_v7 from the list
You should be good to go now.

Android dependancies configuration

I am going through the Android app tutorial here:
http://developer.android.com/training/basics/actionbar/styling.html
As part of what I am doing I added in the appcompat library as part of adding in the themes. Not sure how I got to this point but when I try to run the app I get the error :
"The container 'Android Dependencies' references non existing library 'D:\eclipse-bundle\sdk\extras\android\support\v7\appcompat\bin\android-support-v7-appcompat.jar'"
The library DOES exist, just not at this location. It is located at:
D:\eclipse-bundle\sdk\extras\android\support\v7\appcompat\libs\android-support-v7-appcompat.jar
There does not appear to be any way to edit this property. How do you fix this problem? what is causing it?
Thanks in advance for any help.
Make sure you follow this step to add .jar files.
In the new library project, expand the libs/ folder, right-click
each .jar file and select Build Path > Add to Build Path. For
example, when creating the the v7 appcompat project, add both the
android-support-v4.jar and android-support-v7-appcompat.jar files to
the build path.
I had the same issue so I CMD+Q'd Eclipse and re-opened it.... magically worked. I guess "turning it off an on again" works sometimes :D
You can select your project on eclipse, then right-click...
A menu should appear, you can click on "properties".
A flying screen should appear, you can click on "Java Build Path"
Another flying screen should appear, you can click on the tab "Libraries"
This tab actually hold references to what is in the "libs" folder, and you can delete your old lib and insert your new lib (with the correct path) there.
Would not recommend any of it, actually... Please just import the "support lib project" into your eclipse workspace and make your project reference the imported project as a "lib project".
That is way more handy, and will actually give you a better flexibility for doing more stuff with compatibility lib.
And also, since it is on your workspace, you are the one that compiles it. No future lib reference problems \o/

NetBeans Java OpenGL Library not being found

I'm trying to setup Java OpenGL in NetBeans. I have the library imported, and the ones that I'm trying to include in the file are located at:
HelloWorldJOGL > Libraries > JOGL - jogl-java-src.zip > javax.media.opengl >
All of the libraries being included are there (I can search through them and open them in the project tree in NetBeans), but NetBeans is saying it can't find it. I'm not sure how to tell it specifically to look in the Libraries folder, which seems redundant to me, anyway.
The program files are located at:
HelloWorldJOGL > Source Packages > helloworldjogl > HelloWorldJOGL.class
HelloWorldJOGL > Source Packages > helloworldjogl > HelloWorldJOGL.java
I'm not sure how to let it know the libraries are included, like I included them. Again, to me it seems like it's being really stupid, but I really would like to solve it.
The specific error is called, "package javax.media.opengl does not exist."
It's really easy, just go to projects Tab and then in your project right click on Libraries and click on either Add Library or you can click on Add JAR/Folder.
I think this will resolve your problem.
Netbeans allow us to install plugins, these can be really helpful some time,
like here for using OpenGL here is a plugin for it.
And if you want to know how to install plugins, it's very simple,
Steps for installing plugin,
Goto 'Tools' menu tab
click on 'Plugins'
Goto 'Downloaded' Tab
Click on 'Add Plugins'
Browse for the actual jar file of the plugin, or select all NBM files from the zip file you downloaded
Click on 'Install'
You have to extract the zip archive into a folder! If that doesn't work then you may need the natives for your OS.

java eclipse red exclamation mark

I have just got a new computer and installed Eclipse Indigo and all of the plugins that I use. But when I open my workspace from my old computer some projects have an exclamation mark.
What does a red exclamation mark mean on a project folder?
The red exclamation mark usually means there is a problem with the Build Path.
Do you see any alerts in the "Problem" View?
It means that there is an error on that project..
You can look at all the errors in the Problems tab. press ALT SHIFT Q followed by X to
show this tab.
It means that there are two things happened.........
What ever jar file or project setup jar file for your application
are not located at that point where it was earlier in your computer.
So that First you have to setup your project with all the jar files
and refresh it.
Check syntax in your project might be some mistake in that.
The red exclamation mark in eclipse is because of the problem/issue with the build path.
To find the specific issue look at the problems tab of the eclipse.
Window -> Show View -> Problems (or) Alt+Shift+Q,X
If you didn't find any error on the project files, usually it means your build path has some issue. First Check your jar file and jar file locations.
On eclispe, right click on your project, Go to build path and go to Configure build path. Check any errors under libraries. Configure it correctly and refresh the project.
It appears mostly because of "build path" only. But just in case you are working on a MAVEN project, here is the solution.
Solution
Step 1. Expand your project in Eclipse > Right click on "JRE System Library" > "Build Path" > "Remove From Build path"
Step 2. Expand your project in Eclipse > Right click on "Maven Dependencies" > "Build Path" > "Remove From Build path"
Step 3. Reach out to your local repository and follow below path "C:\Users\userName\.m2\repository" and delete everything inside repository folder
Step 4. Refresh your project in Eclipse
Step 5. Right Click on your project > "Maven" > "Update Project"
Step 6. Just refresh your project and now we are Ready to GO..
In my case show hidden files was enabled and i had added hidden jar file extensions along with the original jars. Adding only the jar files except the hidden files solved the problem
It can appear when any other file other than .jar is added in the jar library. To fix this, remove the file and clean the project.
If it is maven project and your project view having no error. Then try the following steps
Right click the project ---> maven --> update maven
It works for me.
What the error means is that the Java (JDK) version installed needs an update, as the older version could not be read. To rectify the issue, uninstall your Java (JDK) and install the latest version. Restart eclipse and the would be seen resolved.
This may help in case your build path is correct and you have put the right signature and access specifier for main, so maybe used as a hook to try before you make any modifications to your build path.
Just go to your problems bar and delete the problem given for the project, clean the project and build it. It should solve the problem, if these steps cause the red exclamation to go away.

Categories