类'java.io.' 在JRE仿真库INTELLIJ IDEA中不存在

Jak*_* He 7 gwt intellij-idea

我正在使用IntelliJ IDEA 15.0.4开发一个GWT项目.该项目编译并运行.但是IntelliJ一直告诉我JRE Emulation Library中没有java类文件.

请帮我!我的maven pom.xml中缺少什么东西吗?

以下是错误消息: 在此输入图像描述

在此输入图像描述

我的pom.xml:

<properties>
   <maven.compiler.target>1.8</maven.compiler.target>
   <maven.compiler.source>1.8</maven.compiler.source>
</properties>

<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-compiler-plugin</artifactId>
   <configuration>
      <source>1.8</source>
      <target>1.8</target>
   </configuration>
</plugin>

<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-compiler-plugin</artifactId>
   <version>3.5.1</version>
   <configuration>
     <verbose>true</verbose>
     <fork>true</fork>
                       <executable>/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/bin/javac</executable>
     <compilerVersion>1.8</compilerVersion>
   </configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)

这是我的IntelliJ项目配置: 在此输入图像描述

在此输入图像描述

Timesheet.gwt.xml

<?xml version="1.0" encoding="UTF-8"?>

<module rename-to='Timesheet'>
<!-- Inherit the core Web Toolkit stuff.                        -->
<inherits name='com.google.gwt.user.User' />
<inherits name="com.vaadin.polymer.Elements"/>

<!-- Inherit the default GWT style sheet.  You can change       -->
<!-- the theme of your GWT application by uncommenting          -->
<!-- any one of the following lines.                            -->
<inherits name='com.google.gwt.user.theme.standard.Standard' />
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/>     -->

<!-- Other module inherits                                      -->

<!-- Specify the app entry point class.                         -->
<entry-point class='com.campus.client.Timesheet' />

<!-- Specify the paths for translatable code                    -->
<source path='client' />
<source path='shared' />

<!--  <inherits name="com.google.gwt.user.theme.standard.Standard"/> -->
<inherits name="com.google.gwt.user.theme.clean.Clean"/>

<!-- For production, most teams prefer to set the default log level to `OFF` -->
<inherits name="com.allen_sauer.gwt.log.gwt-log-OFF" />

<!-- For development, a default of `DEBUG` is recommended -->
<!--  <inherits name="com.allen_sauer.gwt.log.gwt-log-DEBUG" /> -->


</module>
Run Code Online (Sandbox Code Playgroud)

Lui*_*ani 1

除非您有完整版本的 IntelliJ,否则我强烈建议您使用 Eclipse + GWT 插件进行 GWT 开发。

这是 GWT Jre 模拟类的参考,这里的所有内容都将在客户端工作: http ://www.gwtproject.org/doc/latest/RefJreEmulation.html#Package_java_io

在您的特定情况下,IntelliJ 似乎也找不到 String 类,这表明比 GWT 相关的配置问题更深层次。