我无法在Java中安装LibSVM库。

huangapple go评论114阅读模式
英文:

I can't install library LibSVM in java

问题

我在我的电脑上安装了最新的Ubuntu版本,并尝试多次按照此链接上的说明安装Libsvm库:https://www.php.net/manual/en/svm.requirements.php。
该链接用于在php中安装库,但要添加php扩展,库首先需要在java中安装。

我使用这些命令没有遇到任何问题(显然,我输入了所有最新版本3.24的库命令),但是当我使用javac命令编译test file.java文件时,编译器无法识别我的SVM类...这里我贴出了java文件中的代码。

svm_predict svm = new svm_predict();

我还尝试了这个:

LibSVM svm = new LibSVM();

我真的很绝望,请给我一些提示!

英文:

I have the last Ubuntu version on my computer and i tried many times to install the library Libsvm,following the instructions at this link: https://www.php.net/manual/en/svm.requirements.php.
The link is for installing the library in php,but to add the php extensions,the library need first to be installed in java.

I hadn't any problems with this commands,(obviously,i typed all the commands for the latest version of the library,3.24)but when comes the moment to compile the test file.java with the javac command,the compiler doesn't recognise my SVM class...
Here I paste the code in the java file.

svm_predict svm = new svm_predict();

And I also tried this :

LibSVM svm = new LibSVM();

I'm really desperate,please give me a hint!

答案1

得分: 1

为了在您的Java项目中使用libsvm,您需要将相应的JAR文件(libsvm.jar)添加到您的类路径中。

我建议使用集成开发环境(IDE)(例如Eclipse或IntelliJ)来进行Java编程,以便管理类路径中的库。

如果您喜欢通过javac进行命令行编译,您可以使用参数-cp将库添加到您的类路径中。您可以在这篇Stackoverflow帖子中找到相关详细信息。

英文:

In order to use libsvm within your Java project, you need to add the corresponding JAR file (libsvm.jar) to your classpath.

I suggest to use an IDE (such as Eclipse or IntelliJ) for Java programming in order to manage the libraries in your classpath.

If you prefer to stay with command-line compiling via javac, you can use the parameter -cp to add libraries to your classpath. You can find details for it in this post on Stackoverflow.

huangapple
  • 本文由 发表于 2020年8月17日 04:20:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/63441596.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定