我将第一次使用rootbeer1。我在Windows
7机器,具有GForce 610 GPU的32位系统中。我成功安装了CUDA
5.5,并执行了示例以确保它也能正常工作。然后,我rootbeer1
根据github页中的指导进行安装。
然后,我将Rootbeer.jar
其作为外部jar 加载到NetBeans
IDE中,并复制并粘贴了示例代码(rootbeer
在此处列出)。我所做的一项更改是更改导入,其中github页面中的代码导入了
import edu.syr.pcpratts.rootbeer.runtime.Rootbeer;
import edu.syr.pcpratts.rootbeer.runtime.Kernel;
和我的代码导入
import org.trifort.rootbeer.runtime.Rootbeer;
import org.trifort.rootbeer.runtime.Kernel;
除此之外,我更改rootbeer.runAll(jobs);
为rootbeer.run(jobs);
因为rootbeer.runAll();
不存在。
那是因为netbeans说package edu.syr.pcpratts.rootbeer.runtime.Rootbeer does not exists
。
下面是我的代码
KeepMainTest.java
import java.util.ArrayList;
import java.util.List;
import org.trifort.rootbeer.runtime.Kernel;
import org.trifort.rootbeer.runtime.Rootbeer;
public class KeepMainTest {
public static void main(String[] args){
KeepMainTest app = new KeepMainTest();
int[] array = new int[10];
for(int i = 0; i < array.length; ++i){
array[i] = i;
}
for(int i = 0; i < array.length; ++i){
System.out.println("array["+i+"] = " + array[i]);
}
app.MultiplyArray(array, 5);
for(int i = 0; i < array.length; ++i){
System.out.println("array["+i+"] * 5 = " + array[i]);
}
}
public void MultiplyArray(int[] array, int width){
List<Kernel> jobs = new ArrayList<Kernel>();
for(int i = 0; i < array.length; ++i){
jobs.add(new Multiply(array, i, width));
}
Rootbeer rootbeer = new Rootbeer();
rootbeer.runAll(jobs);
}
}
Multiply.java
import org.trifort.rootbeer.runtime.Kernel;
public class Multiply implements Kernel {
private int[] m_array;
private int m_index;
private int m_width;
public Multiply(int[] array, int index, int width){
m_array = array;
m_index = index;
m_width = width;
}
public void gpuMethod(){
m_array[m_index] *= m_width;
}
}
当我运行此代码时,我得到以下输出,并显示错误
array[0] = 0
array[1] = 1
array[2] = 2
array[3] = 3
array[4] = 4
array[5] = 5
array[6] = 6
array[7] = 7
array[8] = 8
array[9] = 9
Exception in thread "main" java.lang.ClassCastException: Multiply cannot be cast to org.trifort.rootbeer.runtime.CompiledKernel
at org.trifort.rootbeer.runtime.CUDAContext.run(CUDAContext.java:153)
at org.trifort.rootbeer.runtime.Rootbeer.run(Rootbeer.java:105)
at KeepMainTest.MultiplyArray(KeepMainTest.java:34)
at KeepMainTest.main(KeepMainTest.java:20)
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)
这里出了什么问题?
更新资料
我按照2位用户的建议进行了操作。以下是我使用输出的命令。
C:\Users\Dev\Documents\NetBeansProjects\GPU\dist>java -Xmx512m -jar Rootbeer.jar GPU.jar GPU1.jar
C:\Users\Dev\Documents\NetBeansProjects\GPU\dist>java -jar GPU1.jar
第一条命令运作良好,无后顾之忧。但是第二个,当我试图运行Jar时,GPU1.JAR
它给了我以下错误。
array[0] = 0
array[1] = 1
array[2] = 2
array[3] = 3
array[4] = 4
array[5] = 5
array[6] = 6
array[7] = 7
array[8] = 8
array[9] = 9
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7410125c, pid=3532, tid=5948
#
# JRE version: Java(TM) SE Runtime Environment (7.0_51-b13) (build 1.7.0_51-b13)
# Java VM: Java HotSpot(TM) Client VM (24.51-b03 mixed mode, sharing windows-x86
)
# Problematic frame:
# C [rootbeer_x86.dll+0x125c]
#
# Failed to write core dump. Minidumps are not enabled by default on client vers
ions of Windows
#
# An error report file with more information is saved as:
# C:\Users\Dev\Documents\NetBeansProjects\GPU\dist\hs_err_pid3532.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
它生成的html" target="_blank">日志文件如下。
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7410125c, pid=3532, tid=5948
#
# JRE version: Java(TM) SE Runtime Environment (7.0_51-b13) (build 1.7.0_51-b13)
# Java VM: Java HotSpot(TM) Client VM (24.51-b03 mixed mode, sharing windows-x86 )
# Problematic frame:
# C [rootbeer_x86.dll+0x125c]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
--------------- T H R E A D ---------------
Current thread (0x0053c400): JavaThread "main" [_thread_in_native, id=5948, stack(0x00b50000,0x00ba0000)]
siginfo: ExceptionCode=0xc0000005, writing address 0x00000000
Registers:
EAX=0x00000000, EBX=0x33459170, ECX=0x00000000, EDX=0xffffffff
ESP=0x00b9f444, EBP=0x00b9f448, ESI=0x33459170, EDI=0x0053c400
EIP=0x7410125c, EFLAGS=0x00010246
Top of Stack: (sp=0x00b9f444)
0x00b9f444: 00000000 00b9f494 01aba9dd 0053c530
0x00b9f454: 00b9f4b8 00000000 00000000 ffffffff
0x00b9f464: 00000000 00000000 0053cbd8 0053cbe8
0x00b9f474: 00b9f474 33459170 00b9f4b8 3345ac18
0x00b9f484: 00000000 33459170 00000000 00b9f4a4
0x00b9f494: 00b9f4dc 01ab3207 00000000 01ab88c9
0x00b9f4a4: 00000000 00000000 ffffffff 00000000
0x00b9f4b4: 00000000 23553738 00b9f4bc 33457722
Instructions: (pc=0x7410125c)
0x7410123c: 6a 04 8b 4d 14 51 8b 55 10 52 e8 e5 04 00 00 6a
0x7410124c: 00 6a 04 52 50 e8 9a 04 00 00 8b 4d fc 8b 55 18
0x7410125c: 89 14 01 8b e5 5d c2 1c 00 cc cc cc cc cc cc cc
0x7410126c: cc cc cc cc 55 8b ec 51 8b 45 1c 89 45 fc 6a 00
Register to memory mapping:
EAX=0x00000000 is an unknown value
EBX=0x33459170 is an oop
{method}
- klass: {other class}
ECX=0x00000000 is an unknown value
EDX=0xffffffff is an unknown value
ESP=0x00b9f444 is pointing into the stack for thread: 0x0053c400
EBP=0x00b9f448 is pointing into the stack for thread: 0x0053c400
ESI=0x33459170 is an oop
{method}
- klass: {other class}
EDI=0x0053c400 is a thread
Stack: [0x00b50000,0x00ba0000], sp=0x00b9f444, free space=317k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [rootbeer_x86.dll+0x125c]
j org.trifort.rootbeer.runtime.FixedMemory.doWriteInt(JIJ)V+0
j org.trifort.rootbeer.runtime.FixedMemory.writeInt(I)V+10
j MultiplySerializer.doWriteStaticsToHeap()V+40
j org.trifort.rootbeer.runtime.Serializer.writeStaticsToHeap()V+1
j org.trifort.rootbeer.runtime.CUDAContext.writeBlocks(Ljava/util/List;)V+61
j org.trifort.rootbeer.runtime.CUDAContext.run(Ljava/util/List;Lorg/trifort/rootbeer/runtime/ThreadConfig;)V+188
j org.trifort.rootbeer.runtime.Rootbeer.run(Ljava/util/List;)V+20
j KeepMainTest.MultiplyArray([II)V+67
j KeepMainTest.main([Ljava/lang/String;)V+121
v ~StubRoutines::call_stub
V [jvm.dll+0x13f35a]
V [jvm.dll+0x202c6e]
V [jvm.dll+0x13f3dd]
V [jvm.dll+0xc9945]
V [jvm.dll+0xd45e7]
C [java.exe+0x2063]
C [java.exe+0xa591]
C [java.exe+0xa61b]
C [kernel32.dll+0x4ed5c]
C [ntdll.dll+0x637eb]
C [ntdll.dll+0x637be]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j org.trifort.rootbeer.runtime.FixedMemory.doWriteInt(JIJ)V+0
j org.trifort.rootbeer.runtime.FixedMemory.writeInt(I)V+10
j MultiplySerializer.doWriteStaticsToHeap()V+40
j org.trifort.rootbeer.runtime.Serializer.writeStaticsToHeap()V+1
j org.trifort.rootbeer.runtime.CUDAContext.writeBlocks(Ljava/util/List;)V+61
j org.trifort.rootbeer.runtime.CUDAContext.run(Ljava/util/List;Lorg/trifort/rootbeer/runtime/ThreadConfig;)V+188
j org.trifort.rootbeer.runtime.Rootbeer.run(Ljava/util/List;)V+20
j KeepMainTest.MultiplyArray([II)V+67
j KeepMainTest.main([Ljava/lang/String;)V+121
v ~StubRoutines::call_stub
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x03d36800 JavaThread "Thread-0" daemon [_thread_blocked, id=744, stack(0x043a0000,0x043f0000)]
0x009f8800 JavaThread "Service Thread" daemon [_thread_blocked, id=2324, stack(0x03cd0000,0x03d20000)]
0x009f3c00 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=2996, stack(0x03c80000,0x03cd0000)]
0x009f2400 JavaThread "Attach Listener" daemon [_thread_blocked, id=5876, stack(0x03c30000,0x03c80000)]
0x009ef400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2704, stack(0x00dd0000,0x00e20000)]
0x00985400 JavaThread "Finalizer" daemon [_thread_blocked, id=5008, stack(0x03ac0000,0x03b10000)]
0x00980000 JavaThread "Reference Handler" daemon [_thread_blocked, id=5104, stack(0x00d20000,0x00d70000)]
=>0x0053c400 JavaThread "main" [_thread_in_native, id=5948, stack(0x00b50000,0x00ba0000)]
Other Threads:
0x0097e800 VMThread [stack: 0x00c80000,0x00cd0000] [id=4368]
0x00a0a000 WatcherThread [stack: 0x03bb0000,0x03c00000] [id=1076]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap
def new generation total 4928K, used 1472K [0x23420000, 0x23970000, 0x28970000)
eden space 4416K, 33% used [0x23420000, 0x23590190, 0x23870000)
from space 512K, 0% used [0x23870000, 0x23870000, 0x238f0000)
to space 512K, 0% used [0x238f0000, 0x238f0000, 0x23970000)
tenured generation total 10944K, used 0K [0x28970000, 0x29420000, 0x33420000)
the space 10944K, 0% used [0x28970000, 0x28970000, 0x28970200, 0x29420000)
compacting perm gen total 12288K, used 271K [0x33420000, 0x34020000, 0x37420000)
the space 12288K, 2% used [0x33420000, 0x33463ed0, 0x33464000, 0x34020000)
ro space 10240K, 41% used [0x37420000, 0x37852050, 0x37852200, 0x37e20000)
rw space 12288K, 52% used [0x37e20000, 0x38466800, 0x38466800, 0x38a20000)
Card table byte_map: [0x00aa0000,0x00b50000] byte_map_base: 0x00985f00
Polling page: 0x00260000
Code Cache [0x01ab0000, 0x01b50000, 0x03ab0000)
total_blobs=163 nmethods=27 adapters=74 free_code_cache=32138Kb largest_free_block=32909760
Compilation events (10 events):
Event: 0.111 Thread 0x009f3c00 23 java.lang.String::length (6 bytes)
Event: 0.111 Thread 0x009f3c00 nmethod 23 0x01b497c8 code [0x01b498c0, 0x01b49950]
Event: 0.193 Thread 0x009f3c00 24 sun.nio.cs.UTF_8$Encoder::encode (361 bytes)
Event: 0.194 Thread 0x009f3c00 nmethod 24 0x01b49c48 code [0x01b49da0, 0x01b4a228]
Event: 0.194 Thread 0x009f3c00 25 sun.net.www.ParseUtil::encodePath (336 bytes)
Event: 0.195 Thread 0x009f3c00 nmethod 25 0x01b4a988 code [0x01b4ab30, 0x01b4b1d8]
Event: 0.198 Thread 0x009f3c00 26 java.lang.Math::min (11 bytes)
Event: 0.198 Thread 0x009f3c00 nmethod 26 0x01b4bc08 code [0x01b4bd00, 0x01b4bd70]
Event: 0.201 Thread 0x009f3c00 27 % org.trifort.rootbeer.util.ResourceReader::getResourceArray @ 89 (129 bytes)
Event: 0.202 Thread 0x009f3c00 nmethod 27% 0x01b4bdc8 code [0x01b4c040, 0x01b4c9d8]
GC Heap History (0 events):
No events
Deoptimization events (0 events):
No events
Internal exceptions (10 events):
Event: 0.195 Thread 0x0053c400 Threw 0x2352c950 at C:\re\jdk7u51\527\hotspot\src\share\vm\prims\jvm.cpp:1244
Event: 0.195 Thread 0x0053c400 Threw 0x2352f158 at C:\re\jdk7u51\527\hotspot\src\share\vm\prims\jvm.cpp:1244
Event: 0.196 Thread 0x0053c400 Threw 0x23538250 at C:\re\jdk7u51\527\hotspot\src\share\vm\prims\jvm.cpp:1244
Event: 0.197 Thread 0x0053c400 Threw 0x2353b740 at C:\re\jdk7u51\527\hotspot\src\share\vm\prims\jvm.cpp:1244
Event: 0.198 Thread 0x0053c400 Threw 0x2353fb10 at C:\re\jdk7u51\527\hotspot\src\share\vm\prims\jvm.cpp:1244
Event: 0.199 Thread 0x0053c400 Threw 0x23542c50 at C:\re\jdk7u51\527\hotspot\src\share\vm\prims\jvm.cpp:1244
Event: 0.200 Thread 0x0053c400 Threw 0x23545d48 at C:\re\jdk7u51\527\hotspot\src\share\vm\prims\jvm.cpp:1244
Event: 0.200 Thread 0x0053c400 Threw 0x23547d80 at C:\re\jdk7u51\527\hotspot\src\share\vm\prims\jvm.cpp:1244
Event: 0.202 Thread 0x0053c400 Threw 0x23553d88 at C:\re\jdk7u51\527\hotspot\src\share\vm\prims\jvm.cpp:1244
Event: 0.202 Thread 0x0053c400 Threw 0x2357c0d0 at C:\re\jdk7u51\527\hotspot\src\share\vm\prims\jvm.cpp:1244
Events (10 events):
Event: 0.199 loading class 0x38a60f70
Event: 0.199 loading class 0x38a60f70 done
Event: 0.200 loading class 0x00a4b600
Event: 0.200 loading class 0x00a4b600 done
Event: 0.200 loading class 0x00a4bbc0
Event: 0.200 loading class 0x00a4bbc0 done
Event: 0.202 loading class 0x00a4b280
Event: 0.202 loading class 0x00a4b280 done
Event: 0.202 loading class 0x00988088
Event: 0.202 loading class 0x00988088 done
Dynamic libraries:
0x00e80000 - 0x00eaf000 C:\Windows\system32\java.exe
0x77540000 - 0x7767c000 C:\Windows\SYSTEM32\ntdll.dll
0x762d0000 - 0x763a4000 C:\Windows\system32\kernel32.dll
0x75700000 - 0x7574b000 C:\Windows\system32\KERNELBASE.dll
0x76460000 - 0x76500000 C:\Windows\system32\ADVAPI32.dll
0x75ff0000 - 0x7609c000 C:\Windows\system32\msvcrt.dll
0x75a70000 - 0x75a89000 C:\Windows\SYSTEM32\sechost.dll
0x763b0000 - 0x76452000 C:\Windows\system32\RPCRT4.dll
0x758c0000 - 0x75989000 C:\Windows\system32\USER32.dll
0x77720000 - 0x7776e000 C:\Windows\system32\GDI32.dll
0x75a60000 - 0x75a6a000 C:\Windows\system32\LPK.dll
0x75f00000 - 0x75f9d000 C:\Windows\system32\USP10.dll
0x74540000 - 0x746de000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_41e6975e2bd6f2b2\COMCTL32.dll
0x75c40000 - 0x75c97000 C:\Windows\system32\SHLWAPI.dll
0x75ca0000 - 0x75cbf000 C:\Windows\system32\IMM32.DLL
0x75990000 - 0x75a5c000 C:\Windows\system32\MSCTF.dll
0x65f70000 - 0x6602f000 C:\Program Files\Java\jre7\bin\msvcr100.dll
0x62630000 - 0x629b0000 C:\Program Files\Java\jre7\bin\client\jvm.dll
0x6f3e0000 - 0x6f3e7000 C:\Windows\system32\WSOCK32.dll
0x77680000 - 0x776b5000 C:\Windows\system32\WS2_32.dll
0x75ef0000 - 0x75ef6000 C:\Windows\system32\NSI.dll
0x73630000 - 0x73662000 C:\Windows\system32\WINMM.dll
0x758b0000 - 0x758b5000 C:\Windows\system32\PSAPI.DLL
0x73a20000 - 0x73a2c000 C:\Program Files\Java\jre7\bin\verify.dll
0x72d90000 - 0x72db0000 C:\Program Files\Java\jre7\bin\java.dll
0x70f30000 - 0x70f43000 C:\Program Files\Java\jre7\bin\zip.dll
0x5bce0000 - 0x5c620000 C:\Windows\System32\nvcuda.dll
0x760a0000 - 0x7623d000 C:\Windows\system32\SETUPAPI.dll
0x75750000 - 0x75777000 C:\Windows\system32\CFGMGR32.dll
0x75d00000 - 0x75d8f000 C:\Windows\system32\OLEAUT32.dll
0x75d90000 - 0x75eec000 C:\Windows\system32\ole32.dll
0x75820000 - 0x75832000 C:\Windows\system32\DEVOBJ.dll
0x76720000 - 0x7736a000 C:\Windows\system32\SHELL32.dll
0x74100000 - 0x74110000 C:\Users\Dev\.rootbeer\rootbeer_x86.dll
0x70c20000 - 0x70c31000 C:\Users\Dev\.rootbeer\rootbeer_cuda_x86.dll
0x726a0000 - 0x72956000 C:\Windows\system32\nvapi.dll
0x74b30000 - 0x74b39000 C:\Windows\system32\VERSION.dll
0x75880000 - 0x758ae000 C:\Windows\system32\WINTRUST.dll
0x755e0000 - 0x75700000 C:\Windows\system32\CRYPT32.dll
0x755c0000 - 0x755cc000 C:\Windows\system32\MSASN1.dll
0x6da20000 - 0x6db0b000 C:\Windows\system32\dbghelp.dll
VM Arguments:
java_command: GPU1.jar
Launcher Type: SUN_STANDARD
Environment Variables:
JAVA_HOME=C:\Program Files\Java\jdk1.7.0_51
PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\libnvvp;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\Program Files\Hewlett-Packard\Drive Encryption\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files\Windows Kits\8.0\Windows Performance Toolkit\;C:\Program Files\Java\jdk1.7.0_51\bin;C:\Users\Dev\Downloads\Apache Ant\apache-ant-1.9.3-bin\apache-ant-1.9.3\bin
USERNAME=Dev
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 6 Model 37 Stepping 5, GenuineIntel
--------------- S Y S T E M ---------------
OS: Windows 7 Build 7601 Service Pack 1
CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 37 stepping 5, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, popcnt, tsc, tscinvbit
Memory: 4k page, physical 3464308k(1337940k free), swap 6926864k(4493144k free)
vm_info: Java HotSpot(TM) Client VM (24.51-b03) for windows-x86 JRE (1.7.0_51-b13), built on Dec 18 2013 19:09:58 by "java_re" with unknown MS VC++:1600
time: Tue Mar 25 06:18:38 2014
elapsed time: 0 seconds
我现在能做什么?
Marco13在这里是正确的。您需要运行类似
java -jar Rootbeer.jar ArraySumApp.jar ArraySumApp-GPU.jar
然后您需要使用
java -jar ArraySumApp-GPU.jar
问题内容: 此错误是什么意思..它在Eclipse中运行正常,但在intellij idea中运行不正常 当我尝试使用来自Intellij IDea的榻榻米客户端-1.1.6.jar运行榻榻米时出现此错误。 问题答案: 如果您使用的是Kotlin,请添加到您的类中(扩展RealmObject)声明
1. 简介 投放百度可将用户分群中的各项重定向人群圈选后实时推送至信息流推广、搜索推广等百度推广投放端,在投放端您可以选择对应分群包为用户直接投放量身定制的广告,助力精准营销。 2. 使用说明 首先需要接受服务协议,点击同意后进入投放百度报告页; 点击新建定向任务进行推送分群包任务的新建: 首先输入任务名称,规则为10个字符内,仅包含数字、英文、中文的输入; 选择用户分群,包含基础圈选分群、精算分
在这一节中我们将会介绍如何在保持深度外观的情况下将三维世界中的物体投影到二维平面上去。最有代表性的例子是:当我们站在一条笔直的马路的中间向前看时,我们会发现马路的两边会越来越靠近,并最终汇聚成一个点。这就是图形学中常说的透视投影。 为了实现上面的效果,在本节中我们需要生成一个投影矩阵,这个投影矩阵需要满足能够将所有的顶点都投影到范围位于 -1 到 1 之间的规范化空间中(normalizedspa
问题内容: 无法播放此视频错误… !! 看到图片 截屏 怎么办?按下播放按钮后,它说不能播放此视频。需要解决这个问题。 问题答案: 您好,前天我遇到了同样的问题,几乎尝试了所有方法,但都没有成功。之后,我使用了这个库,并且运行良好。只需遵循几个步骤: 第1步。 将其添加到您的gradle 第2步。 将其添加为xml布局中的视频播放。 第3步。 从此处检查如何在您的班级中使用此库, 我这边还有另外一
问题内容: 我想从数据库中获取价值,就我而言,我曾经从数据库中获取价值,但是却遇到了这个错误 这是我的代码 任何帮助将是荣幸:) @raffian,你的意思是这样吗? 问题答案: 问题是 这将返回一个 对象数组 列表 (Object []), 其中包含表中每一列的标量值。Hibernate将使用ResultSetMetadata推断返回的标量值的实际顺序和类型。 解 相关连结 使用迭代器
问题内容: 我正在尝试制作一个屏幕捕获程序。 我所拥有的是一个透明窗口,该窗口将提供要捕获的区域并带有一个按钮,并且我试图实例化一个在使用命令提示符单独执行时有效的类 我试图在按下按钮时实例化此类。 我尝试将其保留在我的代码中,也将代码放入其中。在这两种情况下,我都会得到这些错误 在 和IOException 一致。 保持独立无济于事。甚至什么都不打印。 这是我的代码 并且,可以单独正常工作。 欢