我想在控制台中使用Git,并将Intellij作为我的



我想使用Intellij,但不使用它的git插件。我在控制台中使用eclipse+git,从未遇到过问题。只需推/拉/提交/添加等操作,就可以使用eclipse打开文件。现在我已经切换到Intellij,无论我如何打开/导入拉入的文件到Intellij中,我都会遇到很多错误。

大多数时候它看起来是这样的:

 Exception in thread "main" java.lang.NullPointerException
    at Test.main(Test.java:18)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)

甚至这个:

Exception in thread "main" java.io.FileNotFoundException: C:UsersJohnDesktopTestProgramGitFilesGGDCoutproductionDClevel1.txt (The system cannot find the specified path.)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileReader.<init>(FileReader.java:72)
at model.Map.mapImport(Map.java:35)
at model.Map.<init>(Map.java:26)
at model.Model.initialize(Model.java:120)
at model.Model.<init>(Model.java:37)
at Test.main(Test.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)

然而,有没有任何方法可以绝对正确地将通过Git正确提取的项目文件导入Intellij?我甚至怀疑Intellij的Git插件可能会破坏一切,因为它注意到我使用的文件夹上有Git。

我在这个问题上浪费了很多时间,如果能得到帮助,我会非常高兴的!

问候,John

如果你不想在IntelliJ中使用Git,你应该禁用它。转到配置(在欢迎菜单中)>插件>Git集成,然后取消选择它。看起来像这个

希望它能帮助你。

终于做到了。我以前玩过outputpath设置,但有一个配置我错过了:


1.项目设置-项目-输出路径(选择EXTERNAL输出(不进入项目文件本身),无论您想在哪里)2.项目设置-模块-路径-继承项目编译输出路径。

相关内容

最新更新