Runtime.exec("date 时间");
2000 的话,还得看您有没有权限吧?
2000 的话,还得看您有没有权限吧?
解决方案 »
- "Date now = new Date();"中的“now”是什么语法含义。
- 关于线程死锁的问题(老师说上CSDN标题要够长,回复才够多)
- java中的int...用法是怎么样的?
- 在catch中加入continue,那finally中的语句是否执行
- java 关闭word文件时提示"此程序正由另一应用程序或用户使用.(c:\...\Normal.dot)"?
- 哪位兄弟有fileupload组件 commons-fileupload-1.1-dev.jar,commons-io-1.1-dev.jar, 麻烦发一份给我:[email protected].谢谢!
- 求助!!我的程序为什么会抛出异常?
- create可以用但select不能用的问题急急急
- 请教!!!
- 刚入门,请大家指教。。。
- 关于包的问题
- java中有关new 的问题,不太明白。
Define the following prototype in the header file JNIEXPORT void JNICALL Java_JavaHowTo_setSystemTime
(JNIEnv *, jobject, jshort, jshort);
the JNI function JNIEXPORT void JNICALL Java_JavaHowTo_setSystemTime
(JNIEnv *env, jobject obj, jshort hour, jshort minutes) {
SYSTEMTIME st; GetLocalTime(&st);
st.wHour = hour;
st.wMinute = minutes;
SetLocalTime(&st);
}
The Java JNI wrapper would be class JavaHowTo {
public native void setSystemTime( short hour, short minutes);
static {
System.loadLibrary("javahowto");
}
}
And finally, to use it public class JNIJavaHowTo {
public static void main(String[] args) {
short hour = 10;
short minutes = 21;
// this example will set the system at 10h21 using the Windows API
// SetLocalTime.
JavaHowTo jht = new JavaHowTo();
// set the time at 10h21
jht.setSystemTime(hour, minutes);
}
}