WEKA FP-Growth java code - java

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?

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:

Installation of metadata-extractor

I'm stuck on installation.
I downloaded Maven, but I'm not sure which file within
the metadata-extractor folder (that I downloaded from the repo) to use as the target.
I tried all the files at the top level.
All attempts have failed, e.g.
java -jar metadata-extractor-2.13.0.jar build.gradle
com.drew.imaging.ImageProcessingException: File format could not be determined
I am using v2.13.0 of the meta-data extractor
I've just started to code and took interest in this project but also had issues using it. Instead of using Maven i just downloaded the source code from github and threw the 'com' folder into my myproject/src folder. Then i downloaded the xmpcore-6.1.10.jar library and added it to the Build Path. Got it working that way. I hope someone will give you a better solution but if you just wanna do something right away, you can try this solution.
Try downloading IntelliJ and create a "new project from version controll". Use the URL given on the GitHub page (under download/code). That will save you a lot of problems.

Importing .java and .class file gone wrong in eclipse

Recently I worked on a project on a mac, using eclipse. When I was done with the project I copied certain .java files and their corresponding .class files onto a USB drive and brought it to my personal computer. When I try to use the import feature on eclipse and import everything, my main method is not recognized by eclipse. It will work if I create a new eclipse "class" by the name I have in the program and copy paste the code. I have many classes so I can not do this for each one. Is there any way for me to change all .java/.class files into files that will be read by the system?
Thanks
An eclipse project contains a lot of meta information. Just open the project directory in a file browser, and have a closer look. There are files like .classpath for example.
When you just copy your source code, you leave all the meta information behind!
You should either copy the complete project directory, or simply use the export task to create a ZIP file of your project. (to later import that in other systems).
There is one other way you can do this. Just create a new project with the SAME EXACT PROJECT NAME that you did at school or wherever. After you create your project, go to your file explorer and navigate to the following place:
<"Directory to work-space">/<"Project Name">/src/
For ex: in Windows, it is Generally:
C:/Users/your_name/workspace/projectName/src
In here, copy all your ".java" files.
Now go to eclipse, right click on your project and hit refresh. You will find all your .java files there. Right-click on your project and hit "Run"->"Run as a Java Project". It should run! hope this helps.
PS: You do not need your class if you are executing it in Eclipse. Eclipse will create its own class files.

How to use image4j Library?

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.

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

Categories

Resources