Setting up VS Code for GUI development using JavaFX.

  Рет қаралды 35,682

Innovator

Innovator

Күн бұрын

Пікірлер: 73
@harshith_takkala
@harshith_takkala 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 жыл бұрын
Like if you have got help from the video. Cheers 😎✌
@qanda3246
@qanda3246 2 жыл бұрын
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.
@javaprogrammer-org
@javaprogrammer-org 4 жыл бұрын
I've seen a lot of videos, but this is what I need.. Thanks a lot.
@harshith_takkala
@harshith_takkala 4 жыл бұрын
Welcome ✌ Watch another video on the same topic, which makes easy to compile and run !!!
@haseebhaseeb32
@haseebhaseeb32 Жыл бұрын
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.
@bytejourneycodes
@bytejourneycodes 3 жыл бұрын
Thank you, good and thorough video 👍
@Thamudiiii
@Thamudiiii 3 жыл бұрын
Thank you for this video!
@thomaswildepiano1024
@thomaswildepiano1024 2 жыл бұрын
Any recommendation on how to generate JavaFX getters and setters?
@harshith_takkala
@harshith_takkala 2 жыл бұрын
Sorry no idea about that
@leronmclean9361
@leronmclean9361 4 жыл бұрын
This was exactly what I needed. Thanks!!!
@harshith_takkala
@harshith_takkala 4 жыл бұрын
Glad you like it. Check out other video too, which discusses on the same topic.!
@uzairabdullah208
@uzairabdullah208 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 жыл бұрын
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 жыл бұрын
@@uzairabdullah208 this one kzbin.info/www/bejne/i6uzd5-miNd6f5o
@waldosobrino4589
@waldosobrino4589 3 жыл бұрын
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 жыл бұрын
kzbin.info/www/bejne/i6uzd5-miNd6f5o This is the link
@waldosobrino4589
@waldosobrino4589 3 жыл бұрын
@@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 жыл бұрын
@@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 жыл бұрын
thanks alot for the help .
@jerrydaniel9660
@jerrydaniel9660 3 жыл бұрын
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.
@jihadkhawaja
@jihadkhawaja 3 жыл бұрын
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.
@harshith_takkala
@harshith_takkala 3 жыл бұрын
Yeah 🙂
@justylove7935
@justylove7935 4 жыл бұрын
Why I haven't line Java:Create java Project ?? can you explain pls ??
@harshith_takkala
@harshith_takkala 4 жыл бұрын
May be you haven't installed the extensions I guess .
@justylove7935
@justylove7935 4 жыл бұрын
@@harshith_takkala sr my english not good :< But I think I had java extensions pack
@harshith_takkala
@harshith_takkala 4 жыл бұрын
@@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 жыл бұрын
@@harshith_takkala Thanks you so much I fixed it
@justylove7935
@justylove7935 4 жыл бұрын
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 жыл бұрын
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 жыл бұрын
At what point exactly in video, you are getting error
@Wolfiegangs
@Wolfiegangs 3 жыл бұрын
@@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 жыл бұрын
@@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 жыл бұрын
@@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
@Hazardark
@Hazardark 3 жыл бұрын
VS CODE javaFX have any Free Designer?
@harshith_takkala
@harshith_takkala 3 жыл бұрын
I donno but this guy gay a reply to the same comment I have asked for. Check this out kzbin.info/www/bejne/f4HLon2eaciejaM If I get one, I will make video on that 😀✌
@mahigupta8505
@mahigupta8505 3 жыл бұрын
I want setup for c GTK n vs code
@harshith_takkala
@harshith_takkala 3 жыл бұрын
Oh I will check that out. Thanks !
@mahigupta8505
@mahigupta8505 3 жыл бұрын
@@harshith_takkala thank u
@mahigupta8505
@mahigupta8505 3 жыл бұрын
@@harshith_takkala I m new in coding
@harshith_takkala
@harshith_takkala 3 жыл бұрын
@@mahigupta8505 oh fine !
@harshith_takkala
@harshith_takkala 3 жыл бұрын
Gtk is very huge 🥴 I will try but not sure.
@gouthamreddy4275
@gouthamreddy4275 4 жыл бұрын
This video changes my 6 points to 10 points grade
@harshith_takkala
@harshith_takkala 4 жыл бұрын
🤣👌nice joke, anyways thanks!!
@faizaaftab9813
@faizaaftab9813 3 жыл бұрын
symbol not found error arha h 😓😓😓 20 errors
@harshith_takkala
@harshith_takkala 3 жыл бұрын
Ok, explain in brief
@rockstylex33
@rockstylex33 3 жыл бұрын
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 жыл бұрын
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 жыл бұрын
Too long
@harshith_takkala
@harshith_takkala 3 жыл бұрын
Yes dude You might have used the timestamps below in the description. Thanks
Ozoda - Alamlar (Official Video 2023)
6:22
Ozoda Official
Рет қаралды 10 МЛН
Set up R in VS Code [2024]
18:41
Milos Makes Maps
Рет қаралды 35 М.
Setting Up the Perfect Developer Environment on Linux for 2025
11:58
How to Use JavaFX with Eclipse, IntelliJ, and Visual Studio Code
11:45
C++ vs Rust: which is faster?
21:15
fasterthanlime
Рет қаралды 410 М.
How to setup JavaFX Environment in Visual Studio Code?
14:32
Cool IT Help
Рет қаралды 109 М.
#2 Java Development Kit (JDK) Setup
8:20
Telusko
Рет қаралды 740 М.