2016-04-09 10 views
7

IntelliJ IDEA 15.0.4でGWTプロジェクトを作成しています。このプロジェクトはコンパイルされ実行されます。しかし、IntelliJはJavaクラスファイルがJREエミュレーションライブラリに存在しないことを私に伝え続けます。クラス 'java.io.' JREエミュレーションライブラリに存在しません。INTELLIJ IDEA

私を助けてください!私のmaven pom.xmlに何か不足していますか?ここで

はエラーメッセージです: enter image description here

enter image description here

私の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> 

は私IntelliJのプロジェクトの設定です: enter image description here

enter image description here

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> 
+0

Timesheet.gwt.xmlも共有できますか? –

+0

Timesheet.gwt.xmlを追加しました。 –

+0

実行中のGWTのバージョンは? –

答えて

0

あなたがのIntelliJのフルバージョンを持っていない限り、私は強くあなたがGWT開発のためのEclipse + GWTプラグインを使用することをお勧めします。に指摘している、いずれかのStringクラスを見つけることができませんIntelliJのように思えるあなたの特定のケースでは http://www.gwtproject.org/doc/latest/RefJreEmulation.html#Package_java_io

を:

この

は、ここにあるものはすべてクライアント側で動作しますが、GWT JREの参照がクラスをエミュレートしていますGWT関連のものよりも深い設定の問題です。

0

Oracle JDK 9をArch LinuxにインストールしてプロジェクトSDKとして使用したとき、この問題が発生したようです。 Oracle JDK 9をアンインストールしてOpenJDK 8をインストールし、それをプロジェクトSDKとして設定した後、もうエラーは発生しませんでした。 Java 9とOracle JDKのどちらかがGWTによってうまくサポートされているのではないかと思います。

もう1つの原因としては、SDKを正しく設定していない可能性があります。最初に私はSDKのパスを/usr/lib/jvm/default-runtimeにしましたが、後で実際のパス(/usr/lib/jvm/java-8-openjdk)に変更しました。

関連する問題