a java exception has occured while opening .jar file - java

While execute the jar file. i found this exceptions. But when i tried to double click the .jar file. It shows
if anyone know whats the error. just tell me..

Your jar needs the Jcalendar classes to be executed properly...
is the Jcalendar. jar in the classpath??

For those who Got this error "Java Exception Has Occurred" Try this
I tried the solution in Netbeans. While creating a jar file for swing applications. Your .jar file is placed inside the dist folder. Inside the dist folder you have one lib folder and your .jar folder.
Just select the two lib and jar files and copy and paste in some other new folder. And now you double click your jar file. now your jar file is working fine.

Related

How to export a file to an output folder in IntelliJ

I have a plugin, and I need to add files from the .jar to the data folder.
So far I have tried numerous times and yet no avail. The file in my jar is called EffectList.txt and the output folder is plugins/MageSpells/EffectList.txt

Executable Jar file is not running if it is out of dist folder

I have created a Javafx project named MyProjectName in Netbeans 7.4 and I have added some external jars. Its running fine from Netbeans.
After Clean and Build dist folder is created and few sub folder is created like 1-lib(containing all external jar file),
2-run321...(containing MyProjectName.jar,jnlp,html...etc), 3-webfile,
4-MyProjectName.html, 5-MyProjectName.jar(this executable jar), 6-MyProjectName.jnlp
MyProjectName.jar(5-MyProjectName.jar(this executable jar)) running fine from dist folder.
But when i copy MyProjectName.jar somewhere else and try to run, it is not running .
It show Message Exception while running the application.
But when i put lib folder(1-lib(containing all external jar file)) it is running fine.
How can i run it only from MyProjectName.jar???
that is because you need those dependency jar files.
you can create a jar file by combining all those external jars
Try out this
Try to use this command:
java -jar MyProjectName.jar
This may help you.
Execute a .jar without the lib directory is imposible, because your main .jar will need those .jar depended files. If you need to move your MyProjectName.jar somewhere else and try to run it, you must move the lib directory too, or prove Thusitha' solution.

execuable jar file does not work in different folders

I have a big project and runs well in Eclipse. I build a runnable jar file by eclipse. When I put the jar file directly on the desktop it runs well, however if I make a new folder and move the jar file to the new folder, it does not work correctly, the output file is empty.. No errors appear.

Trouble making executable jar

When I try to make an executable jar in netbeans I get this error
C:\lwjgl\lwjgl-2.8.5\res is a directory or can't be read. Not copying the libraries. Not copying the libraries.The res folder holds files like jpgs and wavs that the program relies on to function. I'm using lwjgl, would that be part of the problem? What could be causing this?
try this
Right click on your project folder and click on >>>>clean and
build<<<<
right click on your project folder click on >>>Properties<<<< you
should see the location of your project folder normally this should
be in your documents folder under NetbeansProject folder. locate
your project name folder inside is a folder called >>>dist<<< in
there you should find your project name with a small java cafe
image which is your jar file.

Jar to Exe - Main class not found

I made a small game in Java.
It had about 5 different classes and the main class being in Game.java
I compiled it into a jar file and I did everything correctly with my manifest.txt which gives the name of the file where the main class is in.
The jar file worked on my computer so I then converted it into an exe file and sent it to someone else.
When My friend tries to run the exe file, it gives him an error saying:
Could not find main class game. Now exiting.
The exe and jar file work fine on my computer but not on a different computer.
We both also run Windows 7.
What went wrong?
I think you need to have every library used in your application beside your EXE file in lib folder. interestingly enough, when lib files are missing, the error shown is about main class, which is so not the case ;) anyway, I had the same problem and got it resolved by including lib folder beside my exe file. this is part of readme.txt generated by net-beans in dist folder, that might be helpful to you:
======================== BUILD OUTPUT DESCRIPTION
when you build an Java application project that has a main class, the
IDE automatically copies all of the JAR files on the projects
classpath to your projects dist/lib folder. The IDE also adds each of
the JAR files to the Class-Path element in the application JAR files
manifest file (MANIFEST.MF).

Categories