JAVA判断是否是IDEA里启动

 

 

/**
     * 判断是否是idea里面启动
     * @return true:是  false:否
     */
    private static boolean checkRunInIDEA() {
        try {
            Class.forName("com.intellij.rt.execution.application.AppMainV2");
            return true;
        } catch (ClassNotFoundException ignored) {
            return false;
        }
    }

 

posted @ 2023-06-27 20:48  yvioo  阅读(107)  评论(0编辑  收藏  举报