参考博客:
Error:(4, 17) java: 程序包org.junit不存在
1.下载jar包
https://www.ej-technologies.com/download/jprofiler/files
2.IDEA中导入jar包
File–>Project Structure–>Libraries–>添加jar包–>应用到当前Module
测试:
import org.junit.Test;
//import org.junit.jupiter.api.Test;
/**
* @author
* @create 2021-03-13 13:30
*/
public class JVMDemo {
public static void main(String[] args) {
//返回虚拟机试图使用的最大内存
long max = Runtime.getRuntime().maxMemory(); //字节
//返回jvm的初始化总内存
long total = Runtime.getRuntime().totalMemory();
System.out.println("最大内存="+max+"字节\t"+(max/1024.0/1024.0)+"MB");
System.out.println("初始化内存" +total + "字节\t" + (total/1024.0/1024.0)+"MB");
//默认情况下,给jvm分配的最大内存是电脑总内存的1/4,初始化内存是电脑总内存的1/64。
//最大内存=3780640768字节 3605.5MB,电脑总内存为16GB
//初始化内存255328256字节 243.5MB
}
@Test
public void speak() {
System.out.println(111);
}
@org.junit.jupiter.api.Test
public void ss(){
}
}