3

新しい Windows 8 に Eclipse 4.2 をインストールし、すべてのプロジェクトをコピーしてインポートしました。すべてのプロジェクトは phonegap に基づいているため、phonegap をビルドします。

元の eclipse では問題なく動作しますが、どれもコンパイルされず、すべて src> app.java によって赤い X が付きます。

私はエラーを理解していないので、どこから始めればよいかわかりません:

マイ コード: コードの一部ではない () 内の行のエラー

package com.x.x;
import android.os.Bundle;         (ERROR=The import android.os.Bundle cannot be resolved)
import com.phonegap.*;
public class App extends DroidGap {         (ERROR= The hierarchy of the type App is inconsistent)
/** Called when the activity is first created. */
@Override                       (ERROR = Override cannot be resolved to a type)
public void onCreate(Bundle savedInstanceState) {      (ERROR=Bundle cannot be resolved to a type)
    super.onCreate(savedInstanceState);
    super.loadUrl("file:///android_asset/www/index.html");   (ERROR = The method loadUrl(String) from the type DroidGap refers to the missing type String)
}
}

エラー行 1:

     Multiple markers at this line
- The type android.os.Bundle cannot be resolved. It is indirectly referenced from 
 required .class files
- The type android.content.Intent cannot be resolved. It is indirectly referenced from 
 required .class files
- The type java.lang.String cannot be resolved. It is indirectly referenced from 
 required .class files
- The type java.lang.Object cannot be resolved. It is indirectly referenced from 
 required .class files
4

5 に答える 5

8

ステップ 1 は JRE セットアップを解決することですが、これは明らかに適切ではありません (java.lang.Object解決できません)。プロジェクト プロパティ、Java ビルド パス、ライブラリを開き、リストで JRE を参照する項目を見つけます。このエントリを編集します。おそらく、ファイルシステムで JRE を見つける必要があります。

于 2012-10-28T09:19:29.480 に答える
0

コンパイル設定に移動し、プロジェクト固有の設定を確認してから、コンパイラのバージョンを変更してください。そこから解決できます。

于 2012-10-28T09:28:57.650 に答える