Duplicate a javaws application to edit - java

I use an javaws app that comes with a jnlp file. I want to launch it locally and be able to modify the source code on my computer to fit my exact needs. I use Eclipse as IDE.
I've opened the jnlp file and downloaded all the jar files, then I have used JD-GUI and CFR to decompile the app.
In Eclipse, I've imported all the different ressources jar and put the app decompiled source code within the src folder. I've tried to correct every mistake done by both softwares but the app still crashes due to their mistakes.
Note, if i just import the app as a jar file, it works as expected but i can't edit the files, indeed it's a class file.

Related

Error "Could not find main class" when trying to launch an exe file

I've done quite a bit of research on this problem but a lot of them have to do with running executable jar files.
My problem is I have an .exe file that loads .jar files from a folder. Originally the .exe file was working but after decompiling the .jar file to change a string value and exporting it back into a jar file the .exe file is no longer able to find the main class. I haven't changed the location or any of the names of the classes inside the .jar file so I'm unsure why this error is occurring.
I am not sure what to do as I'm not experienced in java. I have tried opening the .exe file in an editor but I don't see the option to do so.
Also as a side problem, commands like javac don't work in my command prompt and I'm also unaware of what to do about that.
I'd REALLY appreciate any help as I've been trying to solve this for a few hours now and it's starting to get on my nerves.
I am using JD-Gui to decompile the .jar file and Eclipse to edit the decompiled file and export it back into a .jar file.

Include external library jars in jar to mac .app conversion

I am sorry if this question is placed wrong, but considering it is about jars and Java I figured it would probably be the closest to my subject.
I have a Java program of which I have made, this program I am going to distribute for Mac and Windows. To do this for Windows I have used Launch4j, which works without any issues. Now the problem is that when I try to convert the jar into .app for Mac, it doest work, the app just opens and then closes right after. I suppose this is because when converting to Mac .app using Appmaker it doesn't include the external libraries I have used for the program. Because of this I am now wondering how I would add the external libraries to the .app file like I have done on the .exe, where I have just added the .lib folder with all the external library jars into the folder where the .exe is in.
I have tried adding the .lib folder to the content folder which is created for the .app file, but that doesn't work, I have also tried adding it to the ressource folder within the .app file.
One of the options I have found myself is to combine all external libraries and the actual program .jar file into one. It just seems very difficult and really I don't need it to be just one combined .jar, if it can be included in another way.
Not sure of Appmaker but can do something like an uber jar, i.e. a single jar that contains all the classes, basically take all the jars unzip them to a signle folder and then jar them up again.
Not sure what you are using to build but maven has a maven shade plugin that does exactly this.

Cannot open java programs I saved in eclipse

I had no problem running my java code in eclipse last week and I have no problem creating a new java application in eclipse. However, I am unable to open any of the java program files in eclipse that I saved. I checked to see if my jdk se development kit was removed from my computer by mistake and it is still there. What do you think is wrong? Why can't I open my old files? All of my java programs are saved as CLASS files.
Source files are normally saved with a .java extension. Once you compile your source files, javac will generate you some files with a .class extension. These are not source files, and are usually deleted and recreated every time you compile your code. If you want to find your source code, you'll need to look for the .java files on your disk.
If you've deleted your .java files by accident, it is usually possible to decompile the class files into something resembling the original source, but much of the original formatting will be lost - comments etc. This approach is far from ideal, but may help you recover the situation if you cannot recover the original source files. A good decompiler can be found at http://jd.benow.ca/ - you can either download the standalone application, or it has plugins for Eclipse and IntelliJ.
Hi once you compile the source java files .java extn the class files will be created. Check your workspace in your disk there will be a folder as package as you created in eclipse under src folder.

How to test .jar versions?

I have a project I'm working on and planning to export as a .jar to be released to public. However a major problem I have with Java is that some things work in Eclipse, but won't as a .jar file (ie directory problems: sometimes the directory is right in Eclipse, but when exported it will no longer work). I would like to know if there is a way to check for errors in a jar file directly in Eclipse. I know you can import the new jar file as an external jar file and run it that way but I don't like having to reimport a new jar file every single time a create a new version of one. What can I do?
You can write logs in your code and see that logs in java console when your jar start executing.
how exactly you are building jar ? using command or anything else.?

Executable .jar - works for some users, but not others

I recently released an application in the form of a .jar file (built using Eclipse's "Export Runnable Jar File", using Java JRE 6). Most users are able to double click the file and have it run properly, but a few have reported that double clicking the file causes javaw to start, and immediately exit (with no error message).
I have talked with a few users, and walked them through the process of running the .jar from the command line. The users with the issue seem to be getting "Main class not found" errors, even though the .jar has a META-INF folder with a properly formatted MANIFEST.MF file inside.
Is there anything I can do to insure the program will run properly? Is the issue more likely in my program, or in their Java environment?
Thank you.
JAR is non-executable file format and its extension might be not associated with Java. Its better use open source tools like Launch4j or JSmooth to wrap your JAR as an executable file. This way makes your application more user friendly.

Categories

Resources