Вопрос

I'm currently using JCreator 5.0 and JDK 1.7.0_51. I haven't had any issues when coding, and this time I decided to adventure myself in the realms of JavaFX, but it seems I can't reach any of its content. Here's the error I get when I press the "Build File" button:

H:\Tareas\Projects\Test\Test1.java:1: error: package javafx.stage does not exist
import javafx.stage.*;
^
1 error

So, my questions are:

  • Is there something I'm doing wrong?
  • Am I missing something?

I actually haven't coded anything yet, it just seems the import is not working. This is the code so far, by the way, irrelevant I guess:

import javafx.stage.*;
public class Test1 {
    public Test1() { }
}

Thanks in advance!!

By the way, javafx.stage.* is not the only thing that gets me errors, in general, anything coming from javafx.* does the same :C, even "javafx.*" itself, I'm just using that as an example. Cheers!

edit:

I solved it now! and I did it thanks to @MadProgrammer, after reading the thread he provided me! Thanks very much =) it was so simple!

So what I found after reading the thread is that I needed to tell JCreator that such package existed, so I went through these steps in JCreator:

  • went to "Configure" menu
  • then 'Options"
  • then selected "JDK Profiles" in the left menu
  • then selected my "JDK version 1.7.0_51" profile
  • then clicked the "Edit..." button
  • then in the "Classes" tab clicked the "Add" button
  • then selected "Add Archive"
  • then went to my "C:\Program Files\Java\jdk1.7.0_51\jre\lib" folder to select "jfxrt.jar"
  • and finally opened it, click in "Ok", "Ok", et c. and volia! no more errors!

Too long, didn't read: added "jfxrt.jar" to my JDK Profile in JCreator Options =)

Thanks very much!

I will be posting this as an answer soon, I just have to wait a couple hours due to having not enough reputation points, cheers everyone!

Это было полезно?

Решение

  • go to "Configure" menu
  • then 'Options"
  • then select "JDK Profiles" in the left menu
  • then select your "JDK version 1.7.0_51" profile
  • then click the "Edit..." button
  • then in the "Classes" tab click the "Add" button
  • then select "Add Archive"
  • then go to your "C:\Program Files\Java\jdkX.X.X_X\jre\lib" folder to select "jfxrt.jar"
  • and finally open it, click on "Ok", "Ok", et c. and done.

Too long, didn't read: add "jfxrt.jar" to your JDK Profile in JCreator Options =)

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top