- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我尝试了很多选项来解决这个问题,但找不到解决方案。我也创建了头文件和 dll。也设置类路径。 Javac 命令工作正常。当我运行这个文件时,出现错误:无法找到或加载主类 com.log.jni.example.HelloWorld。请你帮助我好吗。这是我的文件。
public class HelloWorld {
private native void print(String path);
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String path="C:\\Capture.pcap";
new HelloWorld().print(path);
}
static {
System.loadLibrary("HelloWorld");
}
}
最佳答案
可能是您的静态初始化程序失败了。
以下代码:
public class Main
{
static
{
if (true)
throw new Error("Error is here");
}
public static void main(String... args)
{
System.out.println("I am running");
}
}
产生输出:
Exception in thread "main" java.lang.Error: Error is here
at Main.<clinit>(Main.java:22)
Could not find the main class: Main. Program will exit.
在“找不到主类”错误之前是否打印出任何堆栈跟踪?在这个例子中,类被找到但初始化失败,因为静态初始化器抛出了异常。在您的代码中,可能怀疑 System.loadLibrary() 调用失败并出现 UnsatisfiedLinkError
。
关于java - JNI 无法找到或加载主类 - 独特的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7492257/
对于 Prometheus 指标集合,如标题,我真的找不到只能通过 type Summary 完成的用例。 ,似乎它们都可以通过 type Histogram 以某种方式完成还。 让我们以请求并发度量
这个问题在这里已经有了答案: Ignore case while using duplicated (1 个回答) 关闭 9 个月前。 使用不区分大小写的 unique(tolower(x)) 删除
应用程序监控服务的一个有用功能是每次发生新的、独特的错误/问题/异常时发送警报(例如电子邮件)(即不是每次发生)。要么只是第一次,要么最多每次 X 次(一天或一周等)。例如,这可以通过 Visual
应用程序监控服务的一个有用功能是每次发生新的、独特的错误/问题/异常时发送警报(例如电子邮件)(即不是每次发生)。要么只是第一次,要么最多每次 X 次(一天或一周等)。例如,这可以通过 Visual
我想要相当于 DB2 中 MySql 的 GROUP_CONCAT 功能。 我尝试过 DB2 的 XML Aggrigate 函数来合并 murows。 SELECT a.ID, sub
我正在运行 python 数据库迁移脚本 (Flask-Migrate) 并添加了 alembic.ddl.imp import DefaultImpl 来解决第一组错误,但现在我收到以下错误。我正在
我有一个逗号分隔的文件“myfile.csv”,其中第 5 列是日期/时间戳。 (mm/dd/yyyy hh:mm)。 我需要列出所有包含重复日期的行(有很多) 我正在通过 cygwin 为 WinX
我使用的是 MySQL 5.7。 我有一个表格如下: -------------------------------------------------- | id | currentcy_id |
所以我有一个像这样的 ng-repeat: Join Ride /md-switch> 但是,每个 md-switch 都有相同的模型,因此当我在 Control
据我了解, Mongoose 预保存 Hook 在将文档插入集合之前但在验证发生之后触发。因此,如果一次验证失败,则不会调用预保存 Hook 。 就我而言,无论如何都会调用它们: 下面的简单代码的作用
如果我对我的目标文件执行此 grep,我会得到例如 275 作为结果。 但是我想学习 awk,所以在 awk 中尝试了这个: awk 'BEGIN { count=0 } /my pattern/
我是一名优秀的程序员,十分优秀!