简体   繁体   English

无法使用 Intellij 进行编译

[英]Unable to compile with Intellij

I'm giving JetBrains IntelliJ IDEA 12.0.4 a spin and have run into an issue when compiling programs.我正在试用 JetBrains IntelliJ IDEA 12.0.4,但在编译程序时遇到了问题。 When I run a program I get the following error:当我运行程序时,出现以下错误:

Internal error: (java.io.FileNotFoundException) \domain.local\usersfolders\roberth\.IntelliJIdea12\system\compile-server\hibernate_test_1ad22f80\timestamps\data (The system cannot find the path specified)
java.io.FileNotFoundException: \domain.local\usersfolders\roberth\.IntelliJIdea12\system\compile-server\hibernate_test_1ad22f80\timestamps\data (The system cannot find the path specified)
    at java.io.RandomAccessFile.open(Native Method)
    at java.io.RandomAccessFile.<init>(RandomAccessFile.java:233)
    at com.intellij.util.io.PagedFileStorage.resizeFile(PagedFileStorage.java:324)
    at com.intellij.util.io.PagedFileStorage.resize(PagedFileStorage.java:308)
    at com.intellij.util.io.ResizeableMappedFile.resize(ResizeableMappedFile.java:72)
    at com.intellij.util.io.ResizeableMappedFile.<init>(ResizeableMappedFile.java:46)
    at com.intellij.util.io.PersistentBTreeEnumerator.<init>(PersistentBTreeEnumerator.java:76)
    at com.intellij.util.io.PersistentEnumeratorDelegate.<init>(PersistentEnumeratorDelegate.java:38)
    at com.intellij.util.io.PersistentEnumeratorDelegate.<init>(PersistentEnumeratorDelegate.java:31)
    at com.intellij.util.io.PersistentHashMap.<init>(PersistentHashMap.java:137)
    at com.intellij.util.io.PersistentHashMap.<init>(PersistentHashMap.java:133)
    at org.jetbrains.jps.incremental.storage.AbstractStateStorage.createMap(AbstractStateStorage.java:122)
    at org.jetbrains.jps.incremental.storage.AbstractStateStorage.<init>(AbstractStateStorage.java:27)
    at org.jetbrains.jps.incremental.storage.TimestampStorage.<init>(TimestampStorage.java:21)
    at org.jetbrains.jps.incremental.storage.ProjectTimestamps.<init>(ProjectTimestamps.java:21)
    at org.jetbrains.jps.cmdline.BuildRunner.load(BuildRunner.java:90)
    at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:181)
    at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:102)
    at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler$1.run(BuildMain.java:107)
    at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:26)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:722)

This occurs with both Run and Debug . RunDebug都会发生这种情况。 What setting do I need to change to correct the paths used to change them to my local classpaths and directories?我需要更改什么设置以更正用于将它们更改为本地类路径和目录的路径?

It seems that your user home is located on a network drive, which is unsupported by IntelliJ您的用户家似乎位于网络驱动器上, IntelliJ 不支持该驱动器

In some environments user's home directory is located on the mapped network drive which is unacceptable for IntelliJ IDEA.在某些环境中,用户的主目录位于映射的网络驱动器上,这对于 IntelliJ IDEA 是不可接受的。 You'll notice the huge performance degradation.你会注意到巨大的性能下降。 You may also want to move system directory to the faster or larger drive partition.您可能还想将系统目录移动到更快或更大的驱动器分区。

You should copy IDEA_HOME\\bin\\idea.properties to your home directory and adjust the following paths so that they point to local directories instead:您应该将IDEA_HOME\\bin\\idea.properties复制到您的主目录并调整以下路径,以便它们指向本地目录:

  • idea.config.path想法.config.path
  • idea.system.path想法.系统.路径
  • idea.plugins.path想法.plugins.path

See the above link for further details.有关更多详细信息,请参阅上面的链接。 If you don't want to lose everything you already configured, just move \\domain.local\\usersfolders\\roberth\\.IntelliJIdea12 to a local folder.如果您不想丢失已配置的所有内容,只需将\\domain.local\\usersfolders\\roberth\\.IntelliJIdea12移动到本地文件夹即可。

i got the below error in windows env:我在 Windows env 中遇到以下错误:

Error:Internal error: (com.intellij.util.io.PersistentEnumeratorBase$CorruptedException) PersistentEnumerator storage corrupted C:\\Users>.IntelliJIdea14\\system\\compile-server\\cmx_cdc441bb\\aj\\aspect_path.dat错误:内部错误:(com.intellij.util.io.PersistentEnumeratorBase$CorruptedException) PersistentEnumerator 存储损坏 C:\\Users>.IntelliJIdea14\\system\\compile-server\\cmx_cdc441bb\\aj\\aspect_path.dat

and deleted the .dat file located at the above path and my jetbrain IDE started compiling all the classes and problem got resolved.并删除了位于上述路径的 .dat 文件,我的 jetbrain IDE 开始编译所有类,问题得到解决。

I faced a similar issue was not able to reload the compiled classes while debugging a program.我遇到了类似的问题,即在调试程序时无法重新加载已编译的类。 Read a few blogs and deleted the compile and compile-server directories under C:/Users/<yourUsername>/.IntelliJIdea<version>/system and I could continue to use class reloading as usual.阅读了一些博客并删除了C:/Users/<yourUsername>/.IntelliJIdea<version>/system下的 compile 和 compile-server 目录,我可以继续像往常一样使用类重新加载。

I had the exact same problem.我有同样的问题。 So I edited the IDEA_HOME\\bin\\idea.properties file and uncommented:所以我编辑了IDEA_HOME\\bin\\idea.properties文件并取消注释:

  • idea.config.path想法.config.path
  • idea.system.path想法.系统.路径
  • idea.plugins.path想法.plugins.path
  • idea.log.path想法.log.path

Then I removed the ${user.home} from the idea.config.path and idea.system.path and everything worked fine.然后我从idea.config.pathidea.system.path删除了${user.home} ,一切正常。

The following steps worked for me:以下步骤对我有用:

  1. Close IntelliJ IDEA关闭 IntelliJ IDEA
  2. Edit IDEA_HOME\\bin\\idea.properties to contain the following lines:编辑IDEA_HOME\\bin\\idea.properties以包含以下几行:

     idea.config.path=C:/Users/<yourUsername>/.IdeaIC/config idea.system.path=C:/Users/<yourUsername>/.IdeaIC/system
  3. Open IntelliJ IDEA打开 IntelliJ IDEA

    • now the .IdeaIC folder (specified above) is created automatically and it has the following structure:现在.IdeaIC文件夹(上面指定)是自动创建的,它具有以下结构:

       .IdeaIC - config - system

I had the same issue with OSX.我在 OSX 上遇到了同样的问题。 What I did is just recreate the directory where IntelliJ caches compiled classes.我所做的只是重新创建 IntelliJ 缓存编译类的目录。

This Error may encounter in IntellijIdea if you try to use some language-specific keywords as your class name or object name.如果您尝试使用某些特定于语言的关键字作为类名或对象名,则 IntellijIdea 中可能会遇到此错误。 In my case once I got a similar kind of error on using the reserved keywords.就我而言,有一次我在使用保留关键字时遇到了类似的错误。

Some options to fix the issue:解决问题的一些选项:

  • Look for the language-specific keyword usage as a class/object name in your codebase.在代码库中查找特定于语言的关键字用法作为类/对象名称。
  • Try to invalidate the cache and restart from the File Menu尝试使缓存无效并从文件菜单重新启动
  • Reimport the project from the source by recreating the .idea directory.通过重新创建 .idea 目录从源重新导入项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM