How to use image4j Library? - java

I'm trying to create a program that can display *.ico file, so when I tried to search on google it's display for this library. I'm running with bluej and try to run the sample test.java and it's shown an error "package net.sf.image4j.codec.ico does not exist"
I'm running this with bluej, so I tried to add image4j-example.jar to bluej library but nothing happen. What am I supposed to do?
thanks

I would check the list of packages that are included in the image4j-example.jar file. It sounds from the name like that JAR file contains examples of how to use the library but not the image4j library itself. You can go here to download the image4j library:
http://image4j.sourceforge.net/
Once you download the .zip file from there and unpack it you should see a folder titled 'image4j-core-0.7'. Inside that folder is an image4j.jar file. I checked it in my IDE and that JAR file does have the net.sf.image4j.codec.ico package. Add that library to your project and give it another shot.

Related

Google OR-Tools: Using in an IDE

I have the Problem that i want to add OR-Tools into my project via eclipse IDE. I want to use the Linear Solver. I added the two jars form the downloaded Zip file. Now i want to run the SimpleLpExample from the OR-Tools site. I've got the Error that no jniortools in java.library.path. I see that at other posts they say you have to run make third_party and make java, but i don't know where i have to run these commands.
When somebody added it successfully into an IDE it would be glade when this person can explain how he does it. Thanks for help.
No. You need to add the path to the jniortools shared library I'm eclipse.
All dynamic libraries are located in the lib/ directory of the extracted archive.
To add the correct path, please follow these instructions:

Error while creating a jar file with BlueJ

I was trying to create a jar file with Bluej and for some reason BlueJ would not let me include libraries that I was using (Specifically the Amazon SDK for Java)
It gave off an error "jar file could not be written correctly, check for access rights" or something along the lines of that. Is this just a BlueJ problem or is there something I need to do before creating a jar file that needs to include third party libraries?
Thanks.
I believe the answer to your question can be found here, at the BlueJ FAQ website:
https://www.bluej.org/faq.html#faq_How_do_I_use_custom_class_libraries__JARs__
The website describes three ways of doing this in BlueJ. The first way is via the "Preferences" dialog. Open the "Preferences" dialogue and select the "Libraries" tab. Then add the location where your classes are as a library path. Restart BlueJ - done. The selected libraries will now be available in all projects that you open.

WEKA FP-Growth java code

i'm trying to find a way to run weka fp-growth java code in ide but it needs the whole weka package(or this is what I thought, because it has errors when I copy it). is there any way for me to get the whole package with out downloading each file separately.
this is the site i'm using to download it.
http://grepcode.com/file/repo1.maven.org/maven2/nz.ac.waikato.cms.weka/weka-dev/3.7.12/weka/associations/FPGrowth.java?av=f
You can download weka.zip file from https://sourceforge.net/projects/weka/files/weka-3-7/3.7.11/
Unzip it. And in your IDE, click on project and add external jars for the project, go to unzipped folder and select weka.jar
Now, you directly use weka in your java code by using import weka.*;
Rather than downloading from a random site from the internet, why don't you just go to the Weka homepage and download the entire source there?

How do I use API's in Netbeans for JAVA?

Ok so there are tonnes of API's out there. I need to use some of them like JIntellitype, iText, docx4j etc. But the problem is I do not know how to go about it in Netbeans.
I tried following the instructions in readme for all these API's but it does not work since there is something I am doing wrong. I am a newbie at JAVA and Netbeans.
Thanks!
[Update]
This is what I tried to do.
I downloaded the JIntellitype API. It contains lots of files including JAR,DLL,CPP etc. When viewed through File->Open Project from Netbeans this folder is displayed as a project.
I created a new JAVA Application project from Netbeans.
I right clicked the Project->Properties->Library and added the API folder there.
Then I tried importing one of the classes from the API called HotkeyListener as follows:
import jintellitype.HotkeyListener;
I received an error saying package does not exist.
Generally you have to add your API jar to your project. Open project properties, find where external libraries are added and add them. Once you are done you can import library classes and use them.
like AlexR said, you should add the jar file with the jintellitype.HotkeyListener in it, not just the directory. You can open jar files with winrar, winzip, 7zip etc...
Regards

How to use a code within a .jar file while writing a program in NetBeans

I am trying to use the jAudioPackage in a class project. I need it's functionality of getting the id3 tag info from the header of a MP3 file. I looked at the website and once you have everything set-up it seems pretty easy to use. I am just having trouble with actually importing the .jar file which contains the code. How would I go about this in NetBeans?
To summarize, I have the .jar file I just dont know how to get to use the code within the file.
Right click on your project and go to Properties -> Libraries -> Add JAR/Folder and select the jar file in the following dialog. It should then have access to it when coding/compiling.
You need to add the jar file in your project's libraries. Read http://netbeans.org/kb/docs/java/project-setup.html#projects-classpath.
Please read the documentation for the library as to what the calls are and then call the required methods in order to accomplish what you are doing. Before you do that you will have to import the jar in to your project...

Categories

Resources