Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Yosuf Ibrahim

Ranch Foreman
+ Follow
since Apr 27, 2017
Yosuf likes ...
Eclipse IDE MySQL Database Java
Egypt
Cows and Likes
Cows
Total received
5
In last 30 days
1
Total given
0
Likes
Total received
19
Received in last 30 days
10
Total given
45
Given in last 30 days
17
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt Green check

Recent posts by Yosuf Ibrahim

Stephan van Hulst wrote:Great!

Please show me your pom.xml, your module-info.java, and tell me what operations you perform to build and run your application.



pom.xml


module-info


Since I already had a project with the name InventoryManagement I named the this one StephanTest since it was an assignment given by you

However, with my project mvn clean install did not work, I had to run clean first then after it was done I could run install or else it threw me an error, with yours however it worked fine
1 day ago
Hello, I completed the assignment and build has been successful. The app launched and worked as intded I hope, every time I pressed the button ".Hello" was rinted in the text area.

And my other good news is I also managed to get my exe version of my app to work. Apparently the jpackaging tool is no fun when working with modules, I rewatched the videos 3 times and realized I didn't have a jmod for my the JDBC, so I tried making one for it since I couldn't find one online but that turned out a total fail after a few hours, and then I remembered that the reason I transferred my project to maven was because my jar was not working before.

So since this time I had a working jar, I tried using Inno again, and guess what, <Drum roll> it works flawlessly and all I have to do now is try it out on other computers to see if it works just as well
1 day ago

Stephan van Hulst wrote:As for why your application is stuck, I couldn't really tell you. But I think in another post you mentioned that you wanted to make it easier for your customers to install a database, so couldn't you just sidestep the entire issue by using an embedded database instead of MySQL?

I decided not to go with that solution due to future updates when I start to learn networking and have multiple devices connect to the database.

And they are not customers :P they are family members with their own small business I am using them as lab rats for my learning journey

Thanks btw I am going to complete the assignment you just gave me and let you know
3 days ago
I managed to do it somehow after following the two tutorials below, The jar is working and so is the .exe but that is only until I the MySQL database is supposed to work and the exe that does not work only the jar does. Upon user entering login details this the method that is supposed to work


Upon successful Login I expect Entries 1,3,4,5,6 and 8 to be executed which is what gets executed when I launch from IDE or the jar, however, when I try to launch the exe Entries 1,3 and 4 gets executed and it stops. I can tell no exception has been thrown or else Entry 9 would have launched but it doesn't which means it gets stuck somehow over here

This is how I packaged my application using jpackage


Videos I watched, yes Mr. Stephan, I took your advice and switched my project to maven, it was a hussle but i managed and my application is probably working now

4 days ago
Due to all my fail attempts in trying to get my app to work I decided why not try out maven. So I installed intellij and followed this youtube tutorial to the letter to try and create a Hello World application export it as a jar and launch it. However, his hello world worked but not mine

I ran in the cmd as you told me earlier and I got this


I unpacked my jar and got the manifest contents and they are as follows:


Youtube tutorial  followed:

5 days ago

Stephan van Hulst wrote:Did you download JavaFX explicitly, did it come with your JDK or did it come with Eclipse?

I downloaded JavaFX explicitly and then I added its Jars in a custom user library to my project. Any project I start I need to add it manually to that project or it does not work
6 days ago

Stephan van Hulst wrote:Can you use an unzipper to unpack the JAR and post the contents of META-INF/MANIFEST.MF?



Yes sir here are the manifest contents


Here is the result I got from running the command you gave me:
6 days ago

Stephan van Hulst wrote:It appears that way, but I'm suspicious of the JavaFX SDK entry on the class path. Can you remove it from the class path without removing it from the module path?

Done that and it has no effect on my project, my application works as supposed to in eclipse but once I export it into a jar it won't launch and when I tried running it using command prompt I got this instead of the error i got last time

6 days ago

They are added to my module path or am I missing something?
6 days ago
While I was trying to follow this tutorial to create the executable I fell upon this error while building which I do not understand


This is my module-info file


How do you fix them?
6 days ago

Stephan van Hulst wrote:Does your project contain a pom.xml file? It's the project descriptor for a Maven build, which I'm sure Eclipse can handle these days.

Maven will make it significantly easier to understand and modify your build. If your project doesn't use Maven, I can't help you further because I'm not an Eclipse user.


It has a build.xml file I am not sure if that is the same but here is what was in it

6 days ago

Stephan van Hulst wrote:
So, to make your JAR executable you need to tell your build tool to add this entry to the manifest. The easiest way to do this depends on your build tool. Are you using Maven? Are you just relying on your IDE? What IDE are you using?

I as just relying on my IDE to do it it, it is eclipse 2021-12
6 days ago

Stephan van Hulst wrote:Open a command line prompt in your operating system, navigate to the folder that contains the JAR, and then type the command that I gave you, replacing "jarname.jar" with the actual name of your JAR.

Got it, thank you

Here is what I get
6 days ago

Stephan van Hulst wrote:Please tell us how you're executing the JAR. Are you simply double-clicking it? That won't work if the JAR is not executable.

Run the following command on the JAR and tell us if there's any output:



I know this is going to be the dumbest question in java history and I will be made fun of for decades for asking this question, but how am I supposed to do that?
6 days ago
Hello, sorry this is the first time I am wrapping up an application so I had no idea how to post my problem , so to answer your queries as follows:
  • I am using Java 17
  • It is a Java FX Application
  • I was trying to launch on the same machine I developed it on
  • The JAR application was not launching either


  • Stephan van Hulst wrote: On top of the excellent points that John has made, the most important thing you didn't tell us was how you know it doesn't work. ItDoesntWorkIsUseless.

    By it won't work I mean it would not launch when I try to open the Jar or the Exe nothing happens, a dialog which takes in a user name and password from the user should appear but it simply does not.

    Stephan van Hulst wrote: I want to point out that a common reason that applications don't work when running them outside of your IDE is that you might be using file paths to reference resources such as images. Static resources should be embedded into your application, not referenced as if they were separate files.



    The application icon is the only image and it is embedded into the application and not referenced

    6 days ago