2016-04-09 14 views
7

IntelliJ IDEA 15.0.4'te bir GWT projesi üzerinde çalışıyorum. Bu proje derleniyor ve çalışıyor. Ancak IntelliJ, JRE Öykünme Kitaplığı'nda java sınıfı dosyalarının bulunmadığını söylüyor.Sınıf 'java.io.' JRE Öykünme kitaplığında bulunmamaktadır. INTELLIJ IDEA

Lütfen yardım edin! Benim maven pom.xmlimde eksik bir şey var mı? İşte

hata iletileri şunlardır: enter image description here

enter image description here

Benim pom.xml: enter image description here

enter image description here

: Burada

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

benim IntelliJ proje yapılandırma vardır Eğer IntelliJ tam sürümünü yoksa

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

Ayrıca, Timesheet.gwt.xml'i paylaşabilir misiniz? –

+0

Timesheet.gwt.xml dosyasını ekledim. –

+0

GWT'nin hangi sürümünü kullanıyorsunuz? –

cevap

0

Sana GWT geliştirme için Eclipse + GWT Eklentisini kullanmak güçlü önermek istiyorum. için işaret olarak, gerek String sınıfı bulamıyorum intellij gibi görünüyor sizin özel durumda http://www.gwtproject.org/doc/latest/RefJreEmulation.html#Package_java_io

:

Bu

burada olduğunu tüm istemci tarafında çalışacak, GWT JRE için referans sınıfı taklit olduğunu GWT'ye göre daha derin bir yapılandırma sorunu.

0

Arch Linux'ta Oracle JDK 9'u kurduğumda ve bunu proje SDK'sı olarak kullandığımda bu problemi yaşadım. Oracle JDK 9'ı kaldırdıktan ve OpenJDK 8'i yükledikten sonra bunu proje SDK'sı olarak ayarladıktan sonra artık hiçbir hata oluşmadı. Java 9 veya Oracle JDK'nın GWT tarafından çok iyi desteklenmediğini merak ediyorum.

Bir başka olası hata nedeni, SDK'yı yanlış ayarlamış olabilirim. İlk önce SDK yolunu /usr/lib/jvm/default-runtime işaret ettim, ancak daha sonra onu gerçek yola değiştirdim (/usr/lib/jvm/java-8-openjdk).