Solved

Plugins and Java

Posted on 1998-12-04
10
286 Views
Last Modified: 2013-11-23
I have some questions about plugi-ns:

1. Is it possble to code plug-ins with Java?

2. Do I have to make different versions of my plug-in for IE and NS browsers?

3. Can you give me some pointers to resources about plug-in programming.
0
Comment
  • 5
  • 4
10 Comments
 
LVL 16

Expert Comment

by:heyhey_
ID: 1228752
what is plugin ?
0
 
LVL 8

Author Comment

by:Christoffer Swanström
ID: 1228753
Plug-ins are programs that enable web browsers to handle data types that it cannot natively handle. Examples are Shockwave, RealPlayer and Acrobat.
0
 
LVL 8

Author Comment

by:Christoffer Swanström
ID: 1228754
Edited text of question
0
 
LVL 16

Expert Comment

by:heyhey_
ID: 1228755
>> Plug-ins are programs that enable web browsers to handle data types that it cannot natively handle.

Plug-ins are web-browser extensions (probably written in their native platform language)
JAva applets are small programs written in platform independent (and browser independend) code. So java applets does not extend browser behaviour, but the HTML code itself. If your clients have Java enabled browser they can use all kinds of applets. Some applets may render PDF files, other applets can act as news group readers or even participate in real-time  multiplayer games ...

applets are much more than simple browser extensions

>> 2. Do I have to make different versions of my APPLET for IE and NS browsers?
no you write only one version of the applet and every Java enabled browser will handle it.

3. Can you give me some pointers to resources about APPLET programming.
try
www.jars.com
www.gamelan.com
0
 
LVL 8

Author Comment

by:Christoffer Swanström
ID: 1228756
Yes, the difference between Java applets, applications and browser plug-ins are all crystal clear to me.

What I'm interested in is _plug-ins_, mind you. I'm just trying to find out if there is anything that stops me from writing the plug-in in Java instead of C/C++. Also I'm interested in the differences between plug-ins for Navigator and Explorer, ie. do I have to put in a considerable amount of extra work to get the plug-in work in both browsers. I would like to somehow assess the amount of work needed for a plug-in before actually starting the project.


0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 2

Expert Comment

by:aziz061097
ID: 1228757
Here is the Procedure for using Java Plugin (I have used a Jar file in this example and will be signing the Jar file using javakey ) . The plugin will work both for Netscape and IE .

you can find more information at the javasoft site

http://www.javasoft.com/products/plugin/1.1.1/docs/index.html

1. Create a JAR file to archive your class files: use the jar tool from the JDK.
All your applet's files have to be located in a single directory, or in subdirectories of that directory.
From within the applet's main directory, use the command:
> jar cvf myjarfile.jar *.class images
to create a new JAR archive (myjarfile.jar) with all the class files and the subdirectory images.

JavaSoft Resources: jar - The Java archive tool

 

2. Modify the applet tag that refers to your applet to preload the JAR file.
Add the ARCHIVE field in your HTML file as follows:
<APPLET CODE=applet_name ARCHIVE=archive_name> ... </APPLET>

JavaSoft Resources: jar Guide

 

3. Sign the JAR file: use the javakey tool from the JDK.
The javakey tool handles the creation and management of identities, public and private keys, and certificates.
To be able to sign your JAR file, you first need to get a certificate: you can either buy one (www.verisign.com) or make one using javakey.

JavaSoft Resources: Using javakey

3.1 Create an identity in the identity database:
> javakey -cs "myName" true

3.2 Generate DSA key pair (public and private) for the identity:
> javakey -gk "myName" DSA 512 my_pub my_priv

3.3 Create a certificate directive file using your preferred editor and save it as a text file (myNameCertDir.txt).
This file contains critical arguments for creating the certificate:
issuer.name = myName
issuer.cert = 1
subject.name = myName
subject.real.name = myName
subject.org.unit = My Comany
subject.org = Company
subject.country = USA
start.date = 1 Jan 1998
end.date = 1 Jan 2000
serial.number = 1001
out.file = myNamecert.cer (file where to output the certificate - optional)

3.4 Generate a certificate:
> javakey -gc myNameCertDir.txt

3.5 Create a signing directive file using your preferred editor and save it as a text file(myNameSignDir.txt):
signer = myName
cert = 1
chain = 0 (always set to 0 in JDK 1.1)
signature.file = myNameSig

3.6 Sign the JAR archive:
> javakey -gs  myNameSignDir.txt myjarfile.jar

 

4. Install the Java Plug-in 1.1.1 from Sun
Netscape Navigator (Communicator) and Microsoft Internet Explorer 4.0 still do not support the Java Platform 1.1 to full extent like the security features.  To launch a signed applet from your favorite browser, you need to install the Java Plug-in 1.1.1 from JavaSoft.  This Plug-in allows users to specify an alternative JVM which can then be used instead of the browser's in-built virtual machine.

For documentation and free download, check the Plug-in web site: java.sun.com/products/plugin/.

After installation, make sure that the file NPJava32.DLL is correctly installed in the Plugins directory of Netscape Navigator and Internet Explorer.

 

5. Convert your HTML file for the Java Plug-in 1.1.1
You need to modify your HTML file in order for the browsers to detect the request for the Plug-in to be executed.
Along with the Java Plug-in 1.1.1, Sun also provides a free tool that will automate the required changes in your HTML file: the HTML Converter.
This tool is free for download from the Plug-in web site: java.sun.com/products/plugin/.

Example - Applet code before modification:
<applet archive="Counter.jar" code="Counter.class" width="600" height="300">
</applet>

Example - Applet code after modification (for Internet Explorer and Netscape Navigator):
<!--"CONVERTED_APPLET"--> <!-- CONVERTER VERSION 1.0 -->

(<object> tag for Internet Explorer)
<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH="600" HEIGHT="300" codebase="http://java.sun.com/products/plugin/1.1.1/jinstall-111-win32.cab#Version=1,1,1,0">
<param name="CODE" value="Counter.class">
<param name="ARCHIVE" value="Counter.jar">
<param name="type" value="application/x-java-applet;version=1.1">

(<embed> tag for Netscape Navigator)
<embed type="application/x-java-applet;version=1.1"
java_CODE="Counter.class"
java_ARCHIVE="Counter.jar"
WIDTH="600" HEIGHT="300"
pluginspage="http://java.sun.com/products/plugin/1.1.1/plugin-install.html">
<noembed></COMMENT></noembed>

</object>

<!--
<APPLET CODE = "Counter.class" ARCHIVE = "Counter.jar" WIDTH = "600" HEIGHT = "300" >
</APPLET>
-->

<!--"END_CONVERTED_APPLET"--></p>

 

0
 
LVL 16

Expert Comment

by:heyhey_
ID: 1228758
... and maybe you are interested in writing plug-ins for Windows, Macintosh, Solaris etc.
plug-ins for a particular browser are programs written i native platform language that support some kind of (native) plug-in protocol
trying to write in a Java program that will support some native plug-in protocol is not an easy task (if possible). Java is designed for writing cross-platform applications (and applets) - not extensions to native once ....
if you really want to write plug-ins - not applets (which is the better choice) you'd better post this question on the "browsers" forum.

hope this helps
  heyhey

0
 
LVL 16

Expert Comment

by:heyhey_
ID: 1228759
and if you really want to write plug-ins in Java instead of C/C++ you sure need to use Microsoft J++ (so that you can access Win platform)

(note: Microsoft J++ is not Java ...)
0
 
LVL 8

Author Comment

by:Christoffer Swanström
ID: 1228760
Sorry, but this really isn't the information I was looking for. Once again, what I'm going to do is write a plug-in and I just want to know if I can do it with Java or do I have to use C/C++. Netscape at least has an SDK for C/C++. Also, I'd like to know if there are any major differences in implementing a plug-in for Microsoft Internet Explorer and Netscape Navigator.

Please read the question and understand what I'm looking for before answering.
0
 
LVL 16

Accepted Solution

by:
heyhey_ earned 80 total points
ID: 1228761
ok
    1. Is it possble to code plug-ins with Java?
plug-ins for Windows version of NN  / IE ? No - that is not possible (or maybe possible, but MUCH TOO HARD - that is almost impossible)

    2. Do I have to make different versions of my plug-in for IE and NS browsers?
if you can use only ActiveX (which is NOT plug-in) - no. Generally you need different plug-in versions for both browsers.

    3. Can you give me some pointers to resources about plug-in programming.
please ask this question at the "Browser Forum"

hope this helps
  heyhey
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Starting to learn JAVA, 7 59
How to get statistic's from a competitors website?! 1 83
MySQL  on Tomcat 8 23
arguments to jar 5 10
I made this because I wanted to get e-mail with a attached csv file so I'd would be able to import user input into a MS Excel template, but I also wanted to register/save all inputs from each day in a file on the server. 1st - It creates a temp C…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now