Discussions
Categories
- 197K All Categories
- 2.5K Data
- 546 Big Data Appliance
- 1.9K Data Science
- 450.8K Databases
- 221.9K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 552 MySQL Community Space
- 479 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.1K ORDS, SODA & JSON in the Database
- 556 SQLcl
- 4K SQL Developer Data Modeler
- 187.2K SQL & PL/SQL
- 21.4K SQL Developer
- 296.4K Development
- 17 Developer Projects
- 139 Programming Languages
- 293.1K Development Tools
- 110 DevOps
- 3.1K QA/Testing
- 646.1K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 161 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.2K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 19 Java Essentials
- 162 Java 8 Questions
- 86K Java Programming
- 81 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 205 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 475 LiveLabs
- 39 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 175 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 233 Portuguese
Applet and JARs

jvr Guest
Member Posts: 8
Hi,
I have created a little applet that calls to a method of a class stored in a jar file which is allocated in the JAVA_HOME/jre/lib/ext/myfile.jar in my computer.
It works, the code at the myfile.jar works correctly in my computer.
The problems begins at the moment to execute the applet in the webserver.
I have saved the myfile.jar at JAVA_HOME/jre/lib/ext/ at server and the applet is on the web root directory. like in my computer.
It works when I have the myfile.jar in my computer at JAVA_HOME/jre/lib/ext/
but when I have deleted myfile.jar in my computer, the class is not found when the applet tries to be executed.
How can I do that the applet, call to methods in the class of myfile.jar in the ext dir at the server?
Is need a servlet?
I have created a little applet that calls to a method of a class stored in a jar file which is allocated in the JAVA_HOME/jre/lib/ext/myfile.jar in my computer.
It works, the code at the myfile.jar works correctly in my computer.
The problems begins at the moment to execute the applet in the webserver.
I have saved the myfile.jar at JAVA_HOME/jre/lib/ext/ at server and the applet is on the web root directory. like in my computer.
It works when I have the myfile.jar in my computer at JAVA_HOME/jre/lib/ext/
but when I have deleted myfile.jar in my computer, the class is not found when the applet tries to be executed.
How can I do that the applet, call to methods in the class of myfile.jar in the ext dir at the server?
Is need a servlet?
Tagged:
Answers
-
BKD wrote:You can't. Servers do not allow external clients to get resources from 'any' place on the server, but just very specific places defined to be open to the public. In any case:
..How can I do that the applet, call to methods in the class of myfile.jar in the ext dir at the server?
<li> An archive starting with "my" should never be ending up in the sub-directories of a Java installation - for either development or deployment.
<li> Developers with as little imagination as prefixing things with 'my' deserve 20 lashes. But I realize, that is my problem - I will deal with it (places back of hand to forehead).Is need a servlet?No. Just make the Jar available in a public place on he server (one place that usually works is the same directory as the HTML - simple but effective) and add a reference to it in the archive attribute of the applet element. -
Hehehe
Hi Andrew,
Is not really the name of the file is an assumed name.
Anyway the name of the file is not a problem for me.
Really I could write all the code in the applet or I could save the other one jar file in a public place like you said, but there is a nonpublic information that I don't want to make very accessible because a jar file is easy to download and decompile it.
Then I created 2 jar files, instead of 1 and I would like to the one with the nonpublic data will not be stored in a public place.
Any suggestion? -
BKD wrote:The 'public' jar has exactly the same access rights as anything else running in your browser so if it can get at your 'private' jar then anything in the browser can. You can't change this.
Then I created 2 jar files, instead of 1 and I would like to the one, with the nonpublic data will not be stored in a public place. -
a jar file is easy to downloadExactly, and that's what the browser does when it loads your applet. So it has to be downloadable. If you have security or privacy concerns about your application you will have to find another solution.
This discussion has been closed.