LibGdx Tools Error - java

I have problem with building my Core/Desktop/Android project in IntelliJ after adding gxd-tools.jar as Core Library.
Please note my imports:
package com.enplug.exampleapp;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.utils.GdxRuntimeException;
import com.enplug.common.logging.ILog;
import com.enplug.sdk.hosting.AppState;
import com.enplug.sdk.hosting.HostedGame;
import com.enplug.sdk.interfaces.FontType;
import com.enplug.sdk.interfaces.IServiceProvider;
import com.enplug.sdk.model.social.SocialFeedDefinition;
import com.badlogic.gdx.graphics.g2d.freetype.*;
import com.badlogic.gdx.tools.imagepacker.TexturePacker2;
and TexturePacker code:
TexturePacker2.process("C:\\pokusatlas", "C:\\pokusatlas", "spritesheet");
Screenshot of my error:
What should I make to avoid this error?

Check the guide about adding libgdx tools to the gradle dependencies. Let me quote the important part:
Tools Gradle
Core Dependency:
Dont put me in core!
==> you should not add gdx tools to core project! Put it in desktop project instead:
compile "com.badlogicgames.gdx:gdx-tools:$gdxVersion"
The issue with adding libgdx-tools to core project is that the libgdx-tools are not compatible with android/ios projects. But android/ios depend on core project, so you cannot add plattform-dependent libs to your core project.
But even if it would be possible to include in core project it wouldn't be a good idea either. I mean you are not going to run TexturePacker in your released apps anyway. Just run TexturePacker during development and include its output in your android assets folder.

Related

How to import jar files in NetBeans

I am trying to build a very basic voice recognition application via a tutorial. I need to add sphinx4-core.jar and sphinx4-data.jar. I added them into my library and am attempting to import them into my code and I get a "package edu.cmu.sphinx.api does not exist" error. Here are my import statements:
import edu.cmu.sphinx.api.Configuration;
import edu.cmu.sphinx.api.LiveSpeechRecognizer;
import edu.cmu.sphinx.api.SpeechResult;
To add the jar files I went to tools -> libraries -> add JAR/Folder

Getting "The import xx cannot be resolved" while trying to run an existing project in eclipse

Please bear with my limited experience of working with Java.
I imported the project https://github.com/karantongay/Split-Large-Excel-File-into-smaller-excel-files-using-Apache-POI into eclipse.
On opening the file excelsplitter.java, I see The import xx cannot be resolved errors against all of the following -
import org.apache.poi.EncryptedDocumentException;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.DateUtil;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.streaming.SXSSFCell;
import org.apache.poi.xssf.streaming.SXSSFRow;
import org.apache.poi.xssf.streaming.SXSSFSheet;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
I understand that the dependency jar could not be found. What is the easiest way to get this included and make me run this.
I know how to import an existing Maven project in eclipse but that's where my knowledge is limited upto.
As per the information provided above, one of the ways is to convert the existing project into maven projects which can be done using right click on Project -> convert into Maven project and then you will be having Pom.xml available in your project where you can add on dependencies.
For above issue, apart from maven stuff ,if you are using correct jar may be it’s on in the build path of the project.
In your eclipse just right click on Java Project and click Configure and you should see “ Convert to Maven Project ” option.
You should see dialogue like this below. Just add “ Name ” and you should be all set.
Don't forget to add your all custom dependencies in pom.xml file.

Eclipse libgdx import cannot be resolved

I am following this tutorial http://steigert.blogspot.com/2012/02/3-libgdx-tutorial-scene2d.html and i get an error in eclipse for these imports:
import com.badlogic.gdx.scenes.scene2d.OnActionCompleted;
import com.badlogic.gdx.scenes.scene2d.actions.Delay;
import com.badlogic.gdx.scenes.scene2d.actions.FadeIn;
import com.badlogic.gdx.scenes.scene2d.actions.FadeOut;
import com.badlogic.gdx.scenes.scene2d.actions.Sequence;
import com.badlogic.gdx.scenes.scene2d.ui.Align;
import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.scenes.scene2d.ui.Image.Scaling;
all other libgdx imports work fine but these give me the import cannot be resolved error
does anyone of you know how to fix this?
Now that I can see my code, yes - the libgdx version used in the steigert demos is not the latest, and lots of scene2d has changed since then.
http://steigert.blogspot.com/2012/07/13-libgdx-tutorial-libgdx-refactoring.html
You can get his refactored/updated code at:
https://code.google.com/p/steigert-libgdx/source/browse/tags/

Java Class PPM, PPMImage not found, where to get JAR Files

I need help and wanted to ask if somebody knows where to get the JAR Files for my system library (eclipse helios), cause I need to use those classes PPM and PPMImage but the import declarations seem not to work
package com.sun.media.imageio.plugins.pnm;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.awt.image.WritableRaster;
import java.io.*;
import java.lang.*;
import com.apple.*;
import de.medieninf.ads.*;
this is what I have implemented so far
I googled this hard but couldnt find anything.
You need to install Java Advanced Image and its plugin Java Advanced Image I/O Tools: JAI 1.1.3 and JAI I/O Tools 1.1
These provide you the PNM plugins are trying to use.

I have downloaded geotools . In which eclipse directory should I put it in for it to be fetched by my java file?

package geotools.data.geojson;
import jts.geom.Coordinate;
import jts.geom.CoordinateSequence;
import jts.geom.Envelope;
import jts.geom.Geometry;
import jts.geom.GeometryCollection;
import jts.geom.LineString;
import jts.geom.MultiLineString;
import jts.geom.MultiPoint;
import jts.geom.MultiPolygon;
import jts.geom.Point;
import jts.geom.Polygon;
import jts.geom.impl.CoordinateArraySequence;
So where should jts and geotools go into for me to be able to access them ?
There is an eclipse quickstart that answers your question; it provides instructions for both use of maven (which is more automatic); and for downloading the jars into a usable eclipse project.
http://docs.geotools.org/latest/userguide/tutorial/quickstart/eclipse.html
The eclipse download includes JTS (and other support libraries as needed).
It should be added to the project's build-path if it's a JAR file.

Categories