Setting up VS Code for GUI development using JavaFX.

Поделиться
HTML-код
  • Опубликовано: 14 янв 2025

Комментарии • 73

  • @harshith_takkala
    @harshith_takkala  3 года назад +3

    Some problems to which these are solutions.
    1. "Error: Could not find or load main class app
    Caused by: java.lang.ClassNotFoundException: app"
    Solution: When u click the run button , VS code gives a warning,
    "The file app.java isn't on the classpath, the runtime may throw class not found error. Do you want to add the parent folder "APP/JavaFx Application/src" to Java source path?"
    Click yes.
    This warning is show only if you have installed "Debugger for Java" extension.
    If this warning is not shown by your VS code, then you can paste the below code in your settings.json, where you find the location of your jar files that you import.
    ```
    "java.project.sourcePaths": [
    "JavaFx Application/src"
    ]
    ```
    If you have any other projects to add under this project, you can update this list accordingly.
    2. After this you might me seeing one more error.
    "Error: JavaFX runtime components are missing, and are required to run this application"
    Solution: Fist, Debug your application's code. Can be done by "create a launch.json file" under "RUNAND DEBUG" of Explorer section.
    Add this vmArgs to the configuration which has the projectName in it.
    ```
    "vmArgs": "--module-path D:\\Java_JFX\\javafx-sdk-14.0.2.1\\lib --add-modules javafx.controls,javafx.fxml",
    ```
    It should be the path to the JavaFX lib folder.
    Then it will work. 👌✨ like anything !!

  • @harshith_takkala
    @harshith_takkala  4 года назад +3

    Like if you have got help from the video. Cheers 😎✌

  • @qanda3246
    @qanda3246 2 года назад +1

    Thank You for your hard work! It took me so much time to get it up and running but this helped a lot in the end.

  • @haseebhaseeb32
    @haseebhaseeb32 Год назад +1

    If I open a Java Fx project that was created by someone else using a Clips, I don’t see the reference library in my visual studio code. How can I add them?

    • @harshith_takkala
      @harshith_takkala  Год назад

      As we have chosen "No build tools" here, this step of creating directory structure has been automated in newer versions of VSCode. This video has been outdated. It detects if the imported folder is java project or not. Then we can manually add jar files in the lib folder. Hope you got it.

  • @javaprogrammer-org
    @javaprogrammer-org 4 года назад +2

    I've seen a lot of videos, but this is what I need.. Thanks a lot.

    • @harshith_takkala
      @harshith_takkala  4 года назад +1

      Welcome ✌
      Watch another video on the same topic, which makes easy to compile and run !!!

  • @thomaswildepiano1024
    @thomaswildepiano1024 3 года назад +1

    Any recommendation on how to generate JavaFX getters and setters?

  • @bytejourneycodes
    @bytejourneycodes 3 года назад +1

    Thank you, good and thorough video 👍

  • @uzairabdullah208
    @uzairabdullah208 3 года назад +3

    Hey, I am getting the error:
    Error: JavaFX runtime components are missing, and are required to run this application
    How do I fix this?

    • @harshith_takkala
      @harshith_takkala  3 года назад +2

      May be you havent imported the required dependency jar files or may be your command for compile is wrongly typed.
      Checkout my other video on the same

    • @uzairabdullah208
      @uzairabdullah208 3 года назад

      @@harshith_takkala I had been running it using the run button on the top right corner

    • @harshith_takkala
      @harshith_takkala  3 года назад

      @@uzairabdullah208 no it doesnt work, if you change the configuration as mentioned in other video, then that button works

    • @uzairabdullah208
      @uzairabdullah208 3 года назад

      @@harshith_takkala can I get a link to that please? Thankyou so much

    • @harshith_takkala
      @harshith_takkala  3 года назад +1

      @@uzairabdullah208 this one
      ruclips.net/video/UzPFlpSrGI8/видео.html

  • @jerrydaniel9660
    @jerrydaniel9660 3 года назад +1

    Hello, please I did not get that part of using command line to change the directory can you be more specific on how it is done. Thanks.

    • @harshith_takkala
      @harshith_takkala  3 года назад

      Are you asking for the moment at 5:10
      Yes, it automatically opens. But now VS code has updated.
      It has provided many features for java developers. This automatic opening of new VS Code window from the project root directory will be done after clicking the confirmation button at the bottom of window after you do these steps.

  • @Thamudiiii
    @Thamudiiii 3 года назад

    Thank you for this video!

  • @justylove7935
    @justylove7935 4 года назад +2

    Why I haven't line Java:Create java Project ?? can you explain pls ??

    • @harshith_takkala
      @harshith_takkala  4 года назад +1

      May be you haven't installed the extensions I guess .

    • @justylove7935
      @justylove7935 4 года назад +1

      @@harshith_takkala sr my english not good :< But I think I had java extensions pack

    • @harshith_takkala
      @harshith_takkala  4 года назад +1

      @@justylove7935 no problem. ✌
      May be
      1. Restart the whole procedure.
      2. Search the "create java project" in command palette, (not in the search box, that may also opens sometimes) (command palette search starts with ">", while search doesnt start with ">".
      3. After installing all, it will ask for reload, tou have to reload vs code.
      If these doesnt work, then I also dont know the slexaxt solution and dont know what's the exact problem you have.
      Hope you got it 🙂

    • @justylove7935
      @justylove7935 4 года назад +1

      @@harshith_takkala Thanks you so much I fixed it

    • @justylove7935
      @justylove7935 4 года назад +1

      error: package javafx.fxml is not visible
      import javafx.fxml.*;
      ^
      (package javafx.fxml is declared in module javafx.fxml, which is not in the module graph)
      1 error
      error: compilation failed
      I can't fixed it, can you help me pls :

  • @Wolfiegangs
    @Wolfiegangs 3 года назад +1

    Error: Could not find or load main class Brown
    C://Users//Big Brown Boi//Downloads
    Is it reading the first word in my username and not the second word?

    • @harshith_takkala
      @harshith_takkala  3 года назад +1

      At what point exactly in video, you are getting error

    • @Wolfiegangs
      @Wolfiegangs 3 года назад +1

      @@harshith_takkala I'm pretty sure it's when trying to configure Json file
      "vmArgs": "--module-path /Users/user/Downloads/javafx-sdk-11.0.2/lib --add-modules javafx.controls,javafx.fxml",

    • @harshith_takkala
      @harshith_takkala  3 года назад +1

      @@Wolfiegangs yes
      There must be two slashes every where instead of one slash , or a single forward slash
      Checkout my other video on the same topic in the channel

    • @Wolfiegangs
      @Wolfiegangs 3 года назад

      @@harshith_takkala C:\\Users\\Big Brown Boi\\Downloads\\openjfx-11.0.2_windows-x64_bin-sdk\\javafx-sdk-11.0.2\\lib
      yes, I have done that

    • @harshith_takkala
      @harshith_takkala  3 года назад +2

      @@Wolfiegangs okay. Check for:
      1. Are the javafx dependencies shown under the "JAVA PROJECTS" section in the "Explorer" tab, after you add the dependencies manually.
      2. Put the "vmArgs":....." in the first element of the list of configurations instead of second one.
      3. If nothing worked, restart the whole procedure

  • @jihadkhawaja
    @jihadkhawaja 3 года назад +1

    For anyone having the Class exception or file not found error, just navigate to the project App . java location in the terminal using cd then run the commands.

  • @waldosobrino4589
    @waldosobrino4589 3 года назад +1

    Do I have to copypaste the compile an run code lines anytime i want to run my code?

    • @harshith_takkala
      @harshith_takkala  3 года назад

      No that's not. This is an idea to compile and run javafx along with importing jar files for auto complete.
      You can check the next video with the same topic which is modified and efficient. This can help you to run code in a click.

    • @harshith_takkala
      @harshith_takkala  3 года назад

      ruclips.net/video/UzPFlpSrGI8/видео.html
      This is the link

    • @waldosobrino4589
      @waldosobrino4589 3 года назад +1

      @@harshith_takkala hey, thanks for responding, I'm currently watching that video but i'm still having the "Error: Could not find or load main class App
      Caused by: java.lang.ClassNotFoundException: App".
      I already edited settings.json to:
      "java.project.sourcePaths": [
      "JavaFx Application/src"
      ]
      but it still throw that error

    • @harshith_takkala
      @harshith_takkala  3 года назад

      @@waldosobrino4589 have you imported the jar files required?.

    • @harshith_takkala
      @harshith_takkala  3 года назад +1

      @@waldosobrino4589 yes. I think you might have put the vmArgs in the object inside configuration list with the mainClass as "${file}". You must include the vmArgs in the configuration with the mainClass declared as "App" (the name of project's main class.
      Hope you get it

  • @rexis2684
    @rexis2684 4 года назад +1

    thanks alot for the help .

  • @Hazardark
    @Hazardark 3 года назад +1

    VS CODE javaFX have any Free Designer?

    • @harshith_takkala
      @harshith_takkala  3 года назад +2

      I donno but this guy gay a reply to the same comment I have asked for.
      Check this out
      ruclips.net/video/IPhqJh4ckWA/видео.html
      If I get one, I will make video on that 😀✌

  • @mahigupta8505
    @mahigupta8505 3 года назад +1

    I want setup for c
    GTK n vs code

  • @gouthamreddy4275
    @gouthamreddy4275 4 года назад +1

    This video changes my 6 points to 10 points grade

  • @leronmclean9361
    @leronmclean9361 4 года назад +3

    This was exactly what I needed. Thanks!!!

    • @harshith_takkala
      @harshith_takkala  4 года назад +1

      Glad you like it. Check out other video too, which discusses on the same topic.!

  • @faizaaftab9813
    @faizaaftab9813 3 года назад

    symbol
    not found error arha h 😓😓😓 20 errors

  • @rockstylex33
    @rockstylex33 3 года назад +1

    I can't believe all this mickey mouse is required, how did software development evolve to this type of huge pile of crap just to get to a point so you can start? This might be a good video, but the IT world needs to get away from installations that are a huge tangled mess like this.

    • @harshith_takkala
      @harshith_takkala  3 года назад +1

      Yeah the point is absolutely correct, but we have evolved a lot.
      We were using machines with floppy/drives to install any software. And then internet has evolved and installations were easier. Open source evolved and installations were free. Linux distros came into picture and made most of the installations complete with a single command !!!
      And also we have IDEs to make our development easy right?. This was just an experimental video of how you can make a semi text editor, work and provide functionality like IDE....

  • @develt2012
    @develt2012 3 года назад +1

    Too long

    • @harshith_takkala
      @harshith_takkala  3 года назад +1

      Yes dude
      You might have used the timestamps below in the description. Thanks