我试图在Jupyter上运行一个Java程序,但是出现了多个
UndefinedMagicException
。
使用Java内核IJava
版本1.3.0
,并尝试运行以下单元格:
%%file day.java
import java.util.Calendar;
class day {
public static void main(String[] args) {
Calendar cal = Calendar.getInstance();
int year = cal.get(Calendar.YEAR);
int month = cal.get(Calendar.MONTH) + 1;
int day = cal.get(Calendar.DATE);
int hour = cal.get(Calendar.HOUR_OF_DAY);
int minute = cal.get(Calendar.MINUTE);
System.out.println(year + "/" + month + "/" + day + " " + hour + ":" + minute);
}
}
但是没有创建day.java
文件,而且出现了错误:
io.github.spencerpark.jupyter.kernel.magic.registry.UndefinedMagicException: Undefined cell magic 'file'
at io.github.spencerpark.jupyter.kernel.magic.registry.Magics.applyCellMagic(Magics.java:34)
at io.github.spencerpark.ijava.runtime.Magics.cellMagic(Magics.java:31)
at .(#12:1)
我该如何修复笔记本电脑?