Java: How can I import Trident into my project? - java

I'm trying to use the Trident animation library in my project. I've added the trident.jar to the build path in my Eclipse project but I'm still getting a build path error. The archive required for the library is missing.
Maybe I'm being stupid, but I can't seem to find anything like this on the website. I thought the .jar was the only thing I needed based on examples from around the net. And there doesn't seem to be a full Eclipse project to import either.
If I'm missing something silly, please let me know. Thanks!
Here is the exact error: Description Resource Path Location Type
Archive for required library: '/home/josh/Software/Eclipse Java EE/Trident/trident.jar' in project 'SP-Reversi' cannot be read or is not a valid ZIP file SP-Reversi Build path Build Path Problem

The trident.jaris the only jar you need. The error message indicates, that your trident.jar is corrupted. Try to unjar the file:
jar -xvf trident.jar
IMHO this will produce an error. Try to download the jar once again...

Related

Unable to find CsvReader no matter what I try

So I am trying to make the following code work "https://github.com/jintrone/TEVA", only problem is that I am a Java newbie. At first I got compilation error "it.uniroma1.dis.wsngroup.gexf4j.core does not exist" which I solved by downloading and adding gexf4j jar into the ./lib/ folder. Now the compilation is successful but I get:
Exception in thread "main" java.lang.NoClassDefFoundError: com/csvreader/CsvReader
The file I get this from does the following import com.csvreader.*; I downloaded opencsv-2.4.jar and opencsv-3.7.jar and put them in lib but to no avail (also, lib already contains javacsv.jar). I tried to modify the code to import opencsv.csvreader, import au.com.csvreader'... only to get error: package ... does not exist.
Anyone have an idea? these lang issues are tough on a newbie.
Thank you all
Find below a working step by step howto
get the source repository, either by git clone https://github.com/jintrone/TEvA.git or downloading the ZIP file https://github.com/jintrone/TEvA/archive/master.zip
download a missing library from http://central.maven.org/maven2/it/uniroma1/dis/wsngroup/gexf4j/gexf4j/1.0.0/gexf4j-1.0.0.jar and store it in the lib/ directory
build the project ant
The build will finish with some warnings (had no look after that).
Then you can start the example as (for more information check the README.md of the project)
cd deploy/
java -cp TEvA.jar edu.mit.cci.teva.example.RunSampleCsv ...
edit You might need to amend the file resources/cfinderbatch.properties (before the build with ant) and change the path to the cfinder application.
cfinderapplication=/usr/local/bin/cfinder
Change the path to your binary CFinder_commandline (e.g. cfinderapplication=/your/path/CFinder_commandline). Following the manual it should be in the top directory where you have extracted the CFinder*.zip archive. Most probably you need to set the executable flag chmod +x CFinder_commandline.
If all this doesn't solve your problem you might try to contact the CFinder people.

how to include sqlite4java in android project

I am trying to use sqlite4java in my android project. the following screenshot shows my project's setup:
As you can see i have copied the jar-file into my libs folder and included it in the build path. I have also copied the docs and the src-file as per the docs for sqlite4java. The zip-file i downloaded also contains a library-file called libsqlite4java-android-i686.sothat i included in the libs directory. what i get when i try to run my project (it will compile without complaining) is the follwing error message:
03-04 07:37:13.251: W/System.err(2419):
com.almworks.sqlite4java.SQLiteException: [-91] cannot load library:
java.lang.UnsatisfiedLinkError: Couldn't load sqlite4java-android-i686
from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data
/app/de.redhouse24.android-2.apk"],nativeLibraryDirectories=[/data
/app-lib/de.redhouse24.android-2, /system/lib]]]: findLibrary returned
null
As you can see the file sqlite4java-android-i686.socannot be found. Being wiley, i renamed the libsqlite4java-andriod-i686.so file to sqlite4java-android-i686.so, which is why my project structure shows that name for the file. TBH, i renamed it because i found the suggestion in this discussion:
https://code.google.com/p/sqlite4java/issues/detail?id=42
I also tried to include the so-file in the build path, but that just stopped my project from compiling.
My question: What do i need to do to use sqlite4java in my android project?
Im using a mac and eclipse with adt, if that makes any difference.
First of all, renaming the library will not help you. Do not rename the library, leave the name as it was.
Second, you only have the 686-lib there.
If you intent to run your app on something other than an atom-based device, you will have to add the so-files for the other architectures as well.
Each architecture's so-files resides in a sub-directory under the libs directory, like this:
libs/x86
libs/armeabi
libs/armeabi-v7a
Put your libsqlite4java-android-i686.so file there, and also possible other .so files it might need as a dependency, and it should work.
Including the sources and docs into the libs-folder somewhat eludes me. That will only bloat your final apk file, which should be avoided.
Your users will be thankful.

modify weka source code in netbeans

i wanna use weka source code (not jar file!)and i download weka-src.jar from this address
http://www.java2s.com/Code/Jar/w/Downloadwekadev379sourcesjar.htm
and i wanna have weka project in netbeanes in windows .i do step by step this site instruction
http://weka.wikispaces.com/Netbeans+6.0+%28weka-src.jar%29
when i extract jar file into src directory in my project,it give me a lot of error
such as:
package java_cup.runtime does not exist
and a lot of other error.
anyone can tell me how can i do that without any error ?? i am working on this problem for a week and i'm so tired.
please help me if you can.
you have to download java-cup.jar file And add this jar to your classpath
if you didn't find java-cup.jar then you can download jflex.jar jflex also contain java-cup classes so you can download jflex.jar from link below
click on this link

The import com.example cannot be resolved

I am trying to compile this example given by Google on the protocol buffers:
https://developers.google.com/protocol-buffers/docs/javatutorial
It comes with a ListPeople.java and AddPerson.java file along with a bunch of imports. The problem is that i am getting "The import com.example cannot be resolved" as seen in this screenshot:
http://postimg.org/image/67whg6a57/full/
This is the full path of the import com.example java file:
http://postimg.org/image/wexoc4sez/full/
and where all of my files are located:
http://postimg.org/image/4veseacpn/full/
I've tried to do the following:
Project->Clean
File->Refresh
Property->Java build path->add external JAR:
http://postimg.org/image/xjrqhievv/full/
None of these has work. What is the problem?
So this seems to be code that is missing from your project. If you press Shift-Ctrl-T and type in AddressBook, is it there?
If it is not there then it has not been generated from the example .proto files as specifiied in the Google on the protocol buffers files
You're trying to add Java source files as if they're libraries - they're not.
Add the "src" directory as a Source Path (leftmost tab in the Java Build Path settings) instead. Or if that's already a source path, try refreshing it in package explorer. Either way, you definitely don't want to have source files as libraries...

Where is the documentation for the GeoTIFF-jai Library

I am trying to use the GeoTIFF-jai Library to generate a geo-rectified, raster image in Java. I have tried looking on the SourceForge site for the documentation on how to do this, but SourceForge says "Unfortunately, this project hasn't indicated the best way to get help." Has anyone else tried using this library and been able to find any documentation on it?
If there truly is no documentation, maybe you can answer this question. When I import the library .jar file into my Eclipse project (using right-click->Import...->Archive File) all of the .properties files import but not the .class files. I need the GeoTIFFFactory class from org.geotiff.images.jai in order to create a new GeoTIFF image but it's not available. Any idea why the .class files are not importing? Am I doing something wrong on the import? Is the .jar in the wrong directory?
Any help with either of these questions is greatly appreciated.
Thanks,
Ryan
When I import the library .jar file into my Eclipse project (using
right-click->Import...->Archive File) all of the .properties files
import but not the .class files. Am I doing something wrong on the import?
Yes. That's not how you use third-party jars in Eclipse. The wizard you invoked is used primarily for importing archives with source code to make changes to them. Instead create Java project to hold your source code and add a dependency on the jar via Project Properties -> Java Build Path. You can also attach a source code archive in the same place (get this from project's site on SourceForge). This will let you see any available javadoc and if there is no documentation at all, you can at least step through the code.
Regarding lack of documentation, you will be more likely to get help on that project's forum rather than on stack-overflow (since the odds of you finding help on stack-overflow with a particular library is inversely proportional to that library's popularity).

Categories