質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Java

Javaは、1995年にサン・マイクロシステムズが開発したプログラミング言語です。表記法はC言語に似ていますが、既存のプログラミング言語の短所を踏まえていちから設計されており、最初からオブジェクト指向性を備えてデザインされています。セキュリティ面が強力であることや、ネットワーク環境での利用に向いていることが特徴です。Javaで作られたソフトウェアは基本的にいかなるプラットフォームでも作動します。

Q&A

解決済

1回答

1857閲覧

JavaコードJavaFXWnd.javaをEclipse エディタで編集するとエラーだらけになり、さっぱりわかりません

退会済みユーザー

退会済みユーザー

総合スコア0

Java

Javaは、1995年にサン・マイクロシステムズが開発したプログラミング言語です。表記法はC言語に似ていますが、既存のプログラミング言語の短所を踏まえていちから設計されており、最初からオブジェクト指向性を備えてデザインされています。セキュリティ面が強力であることや、ネットワーク環境での利用に向いていることが特徴です。Javaで作られたソフトウェアは基本的にいかなるプラットフォームでも作動します。

0グッド

0クリップ

投稿2018/08/07 04:27

Eclipse でjava8を勉強中です。
JavaFXWnd.javaをEclipse エディタで編集するとエラーだらけになります。
少しのエラーだと何とかなりそうですが、
ほぼすべての行でエラーになります。JavaFXWnd.javaのコードの下にエラーを張り付けています。
解決策、またはヒントを教えてください。お願いいたします。
//エラーの内容
Exception in Application start method
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$154(LauncherImpl.java:182)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.Error: Unresolved compilation problems:
override を型に解決できません
アクセス制限: The type 'Stage' is not API (restriction on required library 'C:\pleiades\eclipse\jre\jre\lib\ext\jfxrt.jar')
アクセス制限: The method 'Stage.setTitle(String)' is not API (restriction on required library 'C:\pleiades\eclipse\jre\jre\lib\ext\jfxrt.jar')
アクセス制限: The method 'Window.setWidth(double)' is not API (restriction on required library 'C:\pleiades\eclipse\jre\jre\lib\ext\jfxrt.jar')
アクセス制限: The method 'Window.setHeight(double)' is not API (restriction on required library 'C:\pleiades\eclipse\jre\jre\lib\ext\jfxrt.jar')
アクセス制限: The type 'Label' is not API (restriction on required library 'C:\pleiades\eclipse\jre\jre\lib\ext\jfxrt.jar')
アクセス制限: The constructor 'Label(String)' is not API (restriction on required library 'C:\pleiades\eclipse\jre\jre\lib\ext\jfxrt.jar')
アクセス制限: The type 'Label' is not API (restriction on required library 'C:\pleiades\eclipse\jre\jre\lib\ext\jfxrt.jar')
アクセス制限: The method 'Labeled.setFont(Font)' is not API (restriction on required library 'C:\pleiades\eclipse\jre\jre\lib\ext\jfxrt.jar')
アクセス制限: The constructor 'Font(double)' is not API (restriction on required library 'C:\pleiades\eclipse\jre\jre\lib\ext\jfxrt.jar')
アクセス制限: The type 'Font' is not API (restriction on required library 'C:\pleiades\eclipse\jre\jre\lib\ext\jfxrt.jar')
アクセス制限: The method 'Stage.setScene(Scene)' is not API (restriction on required library 'C:\pleiades\eclipse\jre\jre\lib\ext\jfxrt.jar')
アクセス制限: The constructor 'Scene(Parent)' is not API (restriction on required library 'C:\pleiades\eclipse\jre\jre\lib\ext\jfxrt.jar')
アクセス制限: The type 'Scene' is not API (restriction on required library 'C:\pleiades\eclipse\jre\jre\lib\ext\jfxrt.jar')
アクセス制限: The method 'Stage.show()' is not API (restriction on required library 'C:\pleiades\eclipse\jre\jre\lib\ext\jfxrt.jar')

at sample_topic14.JavaFXWnd.start(JavaFXWnd.java:13) at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$161(LauncherImpl.java:863) at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$174(PlatformImpl.java:326) at com.sun.javafx.application.PlatformImpl.lambda$null$172(PlatformImpl.java:295) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(PlatformImpl.java:294) at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95) at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177) ... 1 more
// JavaFXWnd.java import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.scene.text.Font; import javafx.stage.Stage; public class JavaFXWnd extends Application { public void start(Stage stage) throws Exception { stage.setTitle("Hello, JavaFX"); stage.setWidth(520); stage.setHeight(220); Label lblMsg = new Label("Hello, JavaFX"); lblMsg.setFont(new Font(80)); stage.setScene(new Scene(lblMsg)); stage.show(); } }

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

java - Using JavaFX in JRE 8 - Stack Overflow

↑ここで同じエラーについて質問されています。
「All-in-oneパッケージ入れれ」という解決策が示されていますね。

投稿2018/08/07 04:42

tkturbo

総合スコア5572

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

退会済みユーザー

退会済みユーザー

2018/08/07 05:48

ありがとうございます。 教えてもらったURLでJavaのところを見たのですが探せませんでした。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問