3

I made a small application using Java Swings and then created a jar file of the project using 'clean and build' option in Netbeans. Then, I converted that .jar file in a .exe file using the software 'Launch4j' and it was perfectly running on my laptop. However when I tried running that exe file on other laptop. It displayed the error: Class NewJframe.firstfile couldnot be found. ( I made the database on the other laptop also with MySql Connection).

Please help me clarify why I am getting this error. Also, I would like to know what all are the requirements to run an .exe file on other computer which I made from a .jar file?

4
  • There is no standard for running Java through .exe launchers. You posed a very specific question, asking for general advice. Commented Mar 15, 2013 at 13:15
  • 3
    The problem might be that the "other" computer does not have a JRE installed. Commented Mar 15, 2013 at 13:18
  • Do check the JAVA version installed on the other machines and your machine too. Hope both of them are using the same version. Commented Mar 15, 2013 at 13:28
  • 1
    Yes java is installed and the version are same jdk 1.6 and jre6 :) Commented Mar 15, 2013 at 14:32

3 Answers 3

5

I would pretty much expect something like Launch4j to take care of all your packaging requirements; did it give you options to "include all dependencies" that you didn't click "YES" to...?

It sounds like it's packaged your app, but possibly not the Java runtime envt it needs to run your app.

Sign up to request clarification or add additional context in comments.

2 Comments

How do I add the java run time environment ?
You will need to read that product's manuals etc for information there, I don't know it specifically I'm afraid
4

Try giving him the JAR file and see if he can run that. If he can, It's a problem with Launch4j, if he can't it's a problem with Java.

Alternatively try something like Excelsior JET instead.

1 Comment

Hey! Thank you so much . It is running using Excelsior JET. Thanks once again. :) ( because It takes in all the corresponding files with it and create a proper package ).
2

Class NewJframe.firstfile couldnot be found

Launch4J only bundles your application's main JAR file inside the .exe (or not even that if you select "don't wrap JAR") - any other JARs that the main one depends on must be present in the same relative locations, you can't necessarily copy just the .exe.

1 Comment

No there is only one jar of the whole project that I created using Netbeans and the 'dont wrap jar is not ticked ' :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.