Hi guys
I have an Applet in MyApplet.java file. It uses external .jar libraries and I have to get it work on a Web Browser.
1) I am a complete newbie in writing custom classpath, manifest ecc... which is the correct way to compile my .java file to get the .class?
2) Once i have the .class file, what i have to do in my webspace? where to put the jar files? what i have to write in my html page?
A step by step tutorial would be awesome
There are nice resources out there, for example "The Java Tutorial", which has a section on How to write Applets.
But you seem to need even more basic advise on compiling - so take a look at Getting Started, and later at Deployment. Then come back if you have more concrete problems.
Related
I've tried searching through java documentation. I could not find anything on opening a jar file inside of a java application. To further explain what I`m trying to do I will use an example. MinecraftForge has a folder where all of the mods get loaded from using jar files.
I would like to be able to put jar files inside a folder that will be used by the application. Is this possible and could somebody point me in the right direction.
I use Eclipse IDE and wants to build a jar file for my java applet.
So I go to export...Runnable JAR file...Extract required libraries into generated JAR.
Since I have three classes in the applet, I am not quite sure what should I put in the main-class in manifest. I just choose the class that runs most of the parts of the program as the main class.
But when I put on the website, I got NoClassDefFoundError. So I guess there must be something else going on to deal with more than one class. Can anyone tell me the right procedure to create the jar file and how to edit the manifest with multiple classes that are able to be posted on a website please? Thanks!
I'm making App in Netbeans platform in Java Swing. I want to add and use .DDL file in my App's module.
How can I do that?
how to make .jar file which contain .DDL file?
Add it to a Jar that is on the run-time class-path of the app. Here is a Netbeans tutorial for adding an image - the process is much the same for any non source file.
Access the file by URL or InputStream. Here is an example of getting an URL.
URL urlToResource = this.getClass().getResource("/path/to/the.ddl");
The mention of VC++ and JNI makes me think you are talking about a .DLL file.
In that case, it seems there is a simple solution.
Im attempting to follow a tutorial here that will help me to modify some source code from the twitter4j executable jar to allow me to use twitters native image upload api, unfortunately Im having a tough time figuring out how this is done because these files arent allowing me to edit them at all in eclipse, here is the tutorial im following seems pretty straight forward but the author didnt include the step of how to edit the files assuming this was common knowledge I can only assume.
You have two options open to you.
1) Get the original source code, and package the jar after making your changes.
2) Unzip the jar (any standard unzipping program should do), make your changes and then repackage the jar.
That said, perusing those links (I didn't go very in depth) suggests that those are libraries you can use - not libraries you are required to modify to get to work. What are you trying to achieve by modifying the library?
Can you extract source from tomcat application? The webapp is not deployed as a .war file, it's a bunch of directories, xmls, configurations, .class files, .jars and stuff.
Your comments to Paul Tomblin indicate you already have access to the server. As he said, if you didn't upload the source to start with (which is normal), you can't get it off the server. However, there are a couple of things to note:
Unless you compiled your JSPs prior to uploading, they will contain their own source code and you can download them for use in another project or whatever it is you're trying to do
If you're desperate, you can decompile the .class files using something like JD (http://java.decompiler.free.fr). The decompiled code will not include comments and is not always spot-on, but it will get you much further than you are now.
You don't have to put the source code on your web server, just the compiled class files. So no, if the source isn't on the server, nobody can "pick it up". In a normal configuration, I don't think it's possible even to download the individual class files, but it might be possible if you put your Tomcat webapps directory somewhere where your normal web server (Apache) can find them.