Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Class 'java.io.' is not present in JRE Emulation library INTELLIJ IDEA

I am working on a GWT project in IntelliJ IDEA 15.0.4. This project compileds and runs. But IntelliJ keeps telling me that java class files are not present in JRE Emulation Library.

Please help me! Is there something missing in my maven pom.xml?

Here are the error messages: enter image description here

enter image description here

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

Here are my IntelliJ project 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>
like image 786
Jake He Avatar asked Apr 09 '16 13:04

Jake He


1 Answers

Unless you have the full version of IntelliJ I would strongly suggest you to use Eclipse + GWT Plugin for GWT development.

This is the reference for GWT Jre emulated class, all that is in here will work on the client side: http://www.gwtproject.org/doc/latest/RefJreEmulation.html#Package_java_io

In your particular case seems like IntelliJ cannot find the String class either, that points out to a deeper configuration issue than a GWT related one.

like image 165
Luigi Polvani Avatar answered Sep 27 '22 16:09

Luigi Polvani