2016-04-09 27 views
7

Sto lavorando a un progetto GWT in IntelliJ IDEA 15.0.4. Questo progetto è compilato e funziona. Ma IntelliJ continua a dirmi che i file di classe java non sono presenti nella libreria di emulazione JRE.Classe 'java.io.' non è presente nella libreria di emulazione JRE INTELLIJ IDEA

Per favore aiutatemi! C'è qualcosa che manca nel mio maven pom.xml?

Qui ci sono i messaggi di errore: enter image description here

enter image description here

mio 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> 

Ecco il mio progetto IntelliJ config: 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

È possibile condividere anche Timesheet.gwt.xml? –

+0

Ho aggiunto Timesheet.gwt.xml. –

+0

Quale versione di GWT stai usando? –

risposta

0

meno che non abbiate la versione completa di IntelliJ Vorrei suggerire di utilizzare Eclipse + GWT Plugin per lo sviluppo GWT.

Questo è il riferimento per GWT Jre emulato classe, tutto ciò che è qui lavoreranno sul lato client: http://www.gwtproject.org/doc/latest/RefJreEmulation.html#Package_java_io

Nel tuo caso particolare sembra IntelliJ non riesce a trovare la classe String o, che indica a un problema di configurazione più profondo di quello relativo a GWT.

0

Mi sembrava di avere questo problema quando ho installato Oracle JDK 9 in Arch Linux e l'ho usato come SDK del progetto. Dopo aver disinstallato Oracle JDK 9 e installato OpenJDK 8 e averlo impostato come SDK del progetto, non si sono più verificati errori. Mi chiedo se Java 9 o Oracle JDK non siano supportati molto bene da GWT.

Un'altra possibile causa di errore è che forse ho impostato l'SDK in modo errato. Innanzitutto ho puntato il percorso SDK su /usr/lib/jvm/default-runtime, ma in seguito l'ho modificato sul percorso attuale (/usr/lib/jvm/java-8-openjdk).