I have an application (DrawFBP) which has a Help facility. built using JavaHelp. I actually had it working for several years on the Eclipse IDE, but I had never tested it running in the jar file. The Help facility uses a number of html files, and some other stuff, and one informant said I can get them included on the jar file by putting them in a resources folder (src/main/resources) . This seems to have worked! After lots of restructuring, I got my Help facility working on the jar file, but it stopped working on the IDE. The IDE version is crashing on a FileNotFoundException referencing a file with extra levels of qualification - where do they come from? I am probably making several dumb errors - but help would be much appreciated! The project can be found on GitHub - https://github.com/jpaulm/drawfbp . The code and resources are there, but Git wants me to add all my code back in again - not sure why... TIA
Somehow got it working - the trick seems to be to include the resources in a folder called 'resources' under src/main. I will accept this answer - unless someone comes up with a better one!
Related
I am working on some server files in jboss. The main file of data jboss/standalone/deployments/data.tar and data.war I just renamed to data1.tar and data1.war and come back site went down. Again I renamed with data.tar still not working. I am unable to to figure out.
How to fix this am not java programmer, could some one help me
You renamed the application - what did you expect exactly? The server took that as (a) uninstallation of the application under the old filename and (b) installation of an application under the new filename.
Don't fiddle around with things like this.
Disclaimer:
Before I get the standard "this has been asked 1000 times", let me say that yes, I know. I have read and read and read. Looked at JarJar and One-JAR but the problem is: I am self-taught with only a couple of months of experience under me and I am not familiar with Ant or Maven or anything other than vanilla Java. I use NetBeans as my compiler, just to add.
I have written an application for use at my job. It is just a small app that takes certain input and writes it to an Excel file. I downloaded jexcelapi (jxl.jar) and placed that appropriately. I have no trouble running the file inside of NetBeans or from within the dist/ folder after it is built. Therein lies the problem: if I move the app to, say, the Desktop, I get an error from the JVM saying "A Java Exception has occurred." I know that this is due to the fact that the main class is added to the .JAR automatically but to add another lib, I will have to make a "Class-path" statement within my Manifest. I tried that unsuccessfully. I have tried moving the actual jxl.jar file to my jdk folder and I tried calling the entire file path that points directly to the jxl.jar file into my Manifest. The closest I can get is building the .JAR in NetBeans and it adds the lib folder to the dist folder where the app .JAR is.
I want to distribute this app as just a single .JAR without having to send all the users a copy of the jexcelapi lib. It doesn't have to be a .JAR within a .JAR; it can be whatever way is easiest and simplest. As stated before, I am not familiar with Ant and One-Jar draws on that. I am still learning; can someone point me in the right direction with this? Thank you!
There is a better one for novice programmers.
Launch4j gives what you need, even wraps it to exe file. Yu don't need to know programming at all to use this.
OFC there are ANT task if you ant to automatise the Launch4j , but for that you must leant a bit about ANT :)
After hours of exhausting search, I found something that was incredibly short, sweet, and right to the point. You cannot mess it up. Here is the link.
I already imported the jar files in netbeans but my main java file still cannot find the methods. I am using netbeans 7.3.1 on Mac. Does anyone know how make it work?
Thank you,
I also had problem with importing classes from imported jar. It was so damn annoying...
There are couple solutions # web, (clear cache in user's AppData. or make sure to add jar's properly - by using "Add Jar/Folder..." option) but none of them worked for me.
What worked was new project and importing THE SAME (that's sad) jar files into it. So I had 2 project with exactly the same contents, but only one of them was working (compiling).
EDIT:
However, your problem is not related to mine. Root cause of your issue is the jar itself.
It contains class files in default package that is making them impossible to import.
Read here how to import class from default (unnamed) package.
hey guyes just keep your .jar files in the "C:\Program Files\Java\jdk1.7.0_45\jre\lib\ext" it will work definitely.I have tried all the other options but i finally copied my .jar files in above path and it worked.
I've been so frustrated, I can't even begin writing my plugin because I'm having such problems getting a simple testcase to compile.
I followed the guide on IDEAs website to add the library, which seemed to be successful because IntelliSense detects the packages/classes, but then I come to compile.. and package not found
Here's a screenshot: any advice is greatly appreciated thanks.
As you can see, it appears to be picking up the lib in the IDE (detecting package/classes/methods etc.)
It seems you told IntelliJ that the library was the zip file containing all the distribution (sources, documentation, etc.). Extract the zip file, and make it point to the jar file that this zip probably contains.
I am working on Java project (A terraria like sandbox game) and I have come across something that I just don't understand. I have been exporting the project as .jar's as I go along to upload and share with my friends, but the last time I did this, the .jar won't run, but when I run it in eclipse, it runs fine. When I try to run the jar all it does is lose focus on the explorer window for a split second, then goes back. I have tried many things, like changing the main class, changing the META, and moving the files to specific packages, but nothing is working.
The project is 9 classes, so I won't paste all the code for it here, but the latest, non-working source code can be found here (http://www.mediafire.com/?fiw6wq73j7cff4t), the non-working jar here (http://www.mediafire.com/?bhjo162oh3hi2j9), and the working jar here (http://www.mediafire.com/?h918s8xpyxw4psr). If someone with more experience in java could please take a look at this it would be much appreciated.
One of the things I tried was not adding the JPanel (the game), and just leaving the splash screen, and the jar worked. This shows that it must be a problem in the coding somewhere.
Thanks for the time,
I.D.
Couldn't find message comes from your ReadMap class. So check which circumstance leads to this error. Most likely you did not add all classes or other files to your JAR, so file is not found. Check that all needed files are added to exported JAR in Eclipse export dialog. It's also a good idea to provide more debugging info (stacktrace is ok), especially when you are studying. BTW, cool game :)