I am trying to use weka's PLSClassifier using java, but when I tried to import weka.classifiers.functions.PLSClassifier into eclipse, it gives me error(The error is import weka.classifiers.functions.PLSClassifier cannot be resolved). The weka I use is the latest version3.7, but I found no class PLSClass under weka.classifiers.functions.
The documentation for this class is: http://weka.sourceforge.net/doc.stable/weka/classifiers/functions/PLSClassifier.html
I would like to know do I need addition package to support this?
I found an external PLSClass package and solve the problem. It seems that in the original weka library, there is no PLSClass under weka.classifiers.functions package.
Related
So, i am running a java project which have many library that are available in the current working directory but VS code seems to not recognize these library and giving out error "The import ###### cannot be resolved" ex: The import org.apache.pdfbox.pdmodel.PDDocument cannot be resolved"
here is the image that might help you to know more about it
This is the package that i am working on :
Here the org/apache is the library contain the class file that are need to be imported and FileArrangement.java is the file having the import statements
Error i have been receiving
this is what VS code is been showing
i really need your help because i really don't have any idea how to correct this
I have checked other projects and they are also showing the same result although the import statements for java classes like . java.util.ArrayList doesn't show any kind of error and i have tried to clean java in VS code it also didn't work
i just need to correct this error of VS code to import the classes that i need
No error on java.util package
Putting the libraries in your current working directory does not work for Java, you need to add them to the classpath.
If you're using maven, that manages the classpath for you.
If not, you can manage it in VS Code by executing the Java: Configure Classpath command from the Command Palette (Ctrl+Shift+P).
You can add dependencies via Referenced libraries under the JAVA PROJECTS panel.
Or use java.project.referencedLibraries setting in settings.json.
For example:
"java.project.referencedLibraries": [
"library/**/*.jar",
"/home/username/lib/foo.jar"
]
Details can be found in configure-classpath and manage-dependencies.
Recently i just followed the examples of Nutiteq SDK from here.
But unfortunately the MBTilesRasterDataSource is not found. Eclipse shows error on the variable statement on that line. I check inside the package com.nutiteq.rasterdatasources. but found no class using that name. Where does it come from anyway?
The class MBTilesRasterDataSource is part of their advancedlayers library
Looks like in the new version of this library, the class MBTilesRasterDataSource is available under com.nutiteq.datasources.raster
change your import package declaration to com.nutiteq.datasources.raster, the eclipse error should go away.
I'm writing a Java class that will be used to send PDUs across a network- to do this, I am following the tutorial at: Tutorial
In the example, the line:
double lla[] = CoordinateConversions.xyzToLatLonDegrees(c);
appears towards the end of the class, and I see that CoordinateConversions has been imported with the line:
import edu.nps.moves.disutil.CoordinateConversions;
I have tried using the xyzToLatLonDegrees(); method in the class that I am writing- calling it in the same way as is done in the example. However, for some reason, I get a compile error that says:
CoordinateConversions cannot be resolved
on the line where I'm trying to use it, and
The import edu.nps.moves.disutil.CoordinateConversions cannot be resolved
on the line where I am importing it.
Does anyone know why this is, and how I can fix the import, so that I can use the xyzToLatLonDegrees() method?
You need to have the CoordinateConversions class on your classpath. Either by obtaining the source and dropping it into your project (possibly adjusting package names, and only if the license allows), or by finding a JAR containing that class and adding it to your build path in your IDE.
You probably need to download the Java files from here.
I am trying to run a TTest in my program and importing the class necessary for importing it isn't working.
This is where I heard of the class
http://commons.apache.org/proper/commons-math/apidocs/index.html?org/apache/commons/math3/stat/inference/TTest.html
I tried:
import java.lang.Object.org.apache.commons.math3.stat.inference.TTest;
and
import org.apache.commons.math3.stat.inference.TTest;
and a few combinations of those that didn't work either.
If you know how to do it please let me know!
Inside I am constructing using
TTest test = new TTest();
so if that is the error just let me know!
import org.apache.commons.math3.stat.inference.TTest; is the correct way to import the TTest class from commons-math.
Since TTest belongs to an external library (commons-math), you have to download it and tell Java where to find it to build and run your program, this is the classpath and it should be defined if you are using a class which does not belong to the default standard Java classes. If you are not aware of classpath and external libraries in Java, you should definitively read and google about the subject.
I am importing this following :
import org.apache.lucene.analysis.PorterStemmer
in Java program. The whole package is available in refrenced library.
I tried importing
import org.apache.lucene.analysis.PorterStemFilter
and
import org.apache.lucene.analysis.Analyzer;
both are working fine except the first one mentioned
Can anybody point out why ?!
Package org.apache.lucene.analysis.PorterStemmer is not a public package which is why you cannot import it. If you look at this package inside the library, you'll notice that it begins with class PorterStemmer instead of public class PorterStemmer.
My guess is that you have a different version of the Lucene JAR that doesn't contain the class that's failing to work. Open the JAR with WinZip, 7Zip, or some other tool and see if that class is indeed missing. If it is, you either need to find a version of the JAR that has it or rewrite your code to use an alternative.