Installing jars and classes

I just started learning Java (I used books like "Teach yourself java 2 in 24 hours", "Teach yourself java in 21 days", "Teach yourself object oriented programming in 21 days", etc.), but there are still some things that prevent me from succeeding. I have programmed in PHP, Javascript and StarBasic before.
I'm testing some Swing component. I wanted to use a JFormattedTextField with a MaskFormatter over it. But it seems that I don't have the class installed.
My Code
import javax.swing.JFormattedTextField.*;
import javax.swing.text.MaskFormatter;
MaskFormatter formatter = new MaskFormatter("(###) ###-####");
JFormattedTextField textField = new JFormattedTextField(formatter);Error message: Type MaskFormatter not found
How can I check if the class is installed? I use a Linux deriviant Kubuntu. I looked at /usr/share/java/ , where I find a lot of jars, but none applicable. How do I even know what my classpath is?

I use Sun Java 6. This compiles without error for me:
import javax.swing.text.MaskFormatter;
public class XXX
    public static void main(String[] args) throws java.text.ParseException
        MaskFormatter formatter = new MaskFormatter("(###) ###-####");
}

Similar Messages

  • Loading .jar and .class in MX7

    I have a cfx tag that includes a .class and .jar file. I
    could do this on the old MX server but in MX7 the option is not in
    the cfide/administrator.
    I copied the .jar and .class files into the
    c:\cfusionmx7\runtime\lib\ directory and then added them to the
    bottom of the jvm.config file with the following entry. (note: The
    .jar file is called MYNEWFILE.jar)
    java.class.path={application.home}/servers/lib,{application.home}/../lib/macromedia_driver s.jar,{application.home}/lib/cfmx_mbean.jar,{application.home}/lib,{application.home}/lib/ MYNEWFILE.jar,{application.home}/../wwwroot/WEB-INF/lib/
    I then rebooted the server. I also have a ".class" file that
    goes with this. I have no idea where to put that thing. The cfx
    (which I mapped in the administrator).
    I get the standard 500 error saying:
    HTTP 500 - Internal server error
    Internet Explorer
    even though I have debugging going to my laptop.
    Here is the output of the exception.log
    "Error","jrpp-0","07/05/07","16:04:14",,"com/allaire/cfx/CustomTag
    The specific sequence of files included or processed is:
    C:\Inetpub\wwwroot\Pauly\example.cfm "
    java.lang.NoClassDefFoundError: com/allaire/cfx/CustomTag
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown
    Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at
    jrunx.util.JRunURLClassLoader.loadClass(JRunURLClassLoader.java:77)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at
    jrunx.util.JRunURLClassLoader.loadClass(JRunURLClassLoader.java:77)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at
    jrunx.util.JRunURLClassLoader.loadClass(JRunURLClassLoader.java:77)
    at
    jrunx.util.JRunURLClassLoader.loadClass(JRunURLClassLoader.java:69)
    at
    coldfusion.bootstrap.BootstrapClassLoader.loadClass(BootstrapClassLoader.java:207)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at coldfusion.tagext.CfxTag.doStartTag(CfxTag.java:88)
    at
    coldfusion.runtime.CfJspPage._emptyTag(CfJspPage.java:1908)
    at
    cfexample2ecfm2026642798.runPage(C:\Inetpub\wwwroot\Pauly\example.cfm:3)
    at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:152)
    at
    coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:343)
    at
    coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
    at
    coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:210)
    at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
    at
    coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:50)
    at
    coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:52)
    at
    coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:2 8)
    at
    coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
    at
    coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
    at
    coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
    at coldfusion.CfmServlet.service(CfmServlet.java:105)
    at
    coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:78)
    at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
    at
    jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
    at
    jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:257)
    at
    jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
    at
    jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:204)
    at
    jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:349)
    at
    jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:457)
    at
    jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:295)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
    "Information","Thread-10","07/05/07","16:14:10",,"Address
    already in use: JVM_Bind"
    java.net.BindException: Address already in use: JVM_Bind
    at java.net.PlainSocketImpl.socketBind(Native Method)
    at java.net.PlainSocketImpl.bind(Unknown Source)
    at java.net.ServerSocket.bind(Unknown Source)
    at java.net.ServerSocket.<init>(Unknown Source)
    at java.net.ServerSocket.<init>(Unknown Source)
    at
    coldfusion.server.jrun4.metrics.CfstatServer.run(CfstatServer.java:64)
    Any help would be greatly appreciated, as I've been working
    on this for a while. I couldn't find a solution in the forums so I
    thought I would post. Thanks!
    Pauly

    >> java.lang.NoClassDefFoundError:
    com/allaire/cfx/CustomTag
    Is the CFX.jar in the classpath?
    > The option is not in the cfide/administrator.
    What option? The administrator has several options for custom
    jars, tags, et.
    - Extensions -> Custom Tag Paths
    - Extensions -> CFX Tags
    CF will also look in these directories automatically
    - {cf_webroot}/WEB-INF/classes (for classes)
    - {cf_webroot}/WEB-INF/lib (for jars)

  • .jar and .class

    I am very new to Java world. Anyone know the difference between *.jar and *.class file. Another one is java servlet and java applet, are they the same? Please give simple answer. Thanks.

    Hi,
    When you compile any Java file, it will create its class file.
    And jar file is a collection of such different class files.
    Servlet is a server side application/program which runs on the webserver & gives the output in html format.
    Applet is a client side application/program which runs on the client machine. But there are many restrictions for applet such as it can not access the local machine file system etc.
    You can get more details about Applet & Servlet on this site.
    Bye.
    Ajay.

  • Java - referencing external jar and class files

    When compiling (loadjava) a Java class, how can an externally referenced '.jar file' be resolved please? Using '-resolve' doesn't do the job in this case.
    Many thanks.

    I think I've seen an option for this with manifest files (or was it something that had to do with the java plug-in). There was something about the version and only download a new version if it was newer than the one on your local computer. This version thing is something you define in the manifest file at least. Take a look at jar and manifest files, there might be something there.

  • Jars and .class files - security of the source code

    Hi,
    I have an app that is in a jar file with the .class files (so no source code).
    I'm wondering how difficult it is to attain the source code from these .class files in my jar? Looking through the contents of the .class files it seems there is a large amount of readable text. For example I see method names, variables, etc.
    This leads me to believe these jars are not secure. What is a better way?
    Thanks!
    Edit:
    Looking around, I've noticed many java decompilers and Sun even supports a dissembler - javap. I think this is not cool, haha.
    What way can I protect my code? To me, the value of java just went way down due to the ease at attaining source code (based on what I read in the past hour or so. I have yet to try it myself). I wonder if this impacts companies reasons not to use java?
    Edit 2:
    I heard that there may be a way to make the jar closed, so you can't say, use winrar, to extract the class files. Does anyone know anything about this?
    Message was edited by:
    dayrinni
    Message was edited by:
    dayrinni

    Hi,
    I have an app that is in a jar file with the .class
    files (so no source code).
    I'm wondering how difficult it is to attain the
    source code from these .class files in my jar?
    Looking through the contents of the .class files it
    seems there is a large amount of readable text. For
    example I see method names, variables, etc.
    This leads me to believe these jars are not secure.
    What is a better way?
    Thanks!
    Edit:
    Looking around, I've noticed many java decompilers
    and Sun even supports a dissembler - javap. I think
    this is not cool, haha.
    What way can I protect my code? To me, the value of
    java just went way down due to the ease at attaining
    source code (based on what I read in the past hour or
    so. I have yet to try it myself). I wonder if this
    impacts companies reasons not to use java?All intellectual property stored in electronic form is vulnerable. Not just Java bytecode. You can use tools called obfuscators to make decompiling more difficult, which is usually good enough. The truth is, no matter how great you think your code is, it's of a lot less interest to others than you actually think. Unless you've got a particularly sexy argorithm or something, it's not really worth worrying too much about
    All you can do is make it more difficult for people to crack things, never prevent it. True of all languages, all electronic media

  • Trouble installing jar and jad files on E62

    hi i use a nokia E62 device and i am not able to install any jar or jad file on it. i am able to instal all sis and sisx applications without any trouble.it gives an error-unable to install when ever i try to install any jar file.
    please please urgent help required any sort of help would be apprecatd

    Hi can yo tell me how to get jar/jad.pls

  • Weblogic.jws.Policies.class is missing in weblogic.jar and wlfullclient.jar

    Hi,
    I am trying to upgrade Weblogic from 9.1 to 10.3.2 or 10.3.3
    In Weblogic 9.1, our application used weblogic.jar in our classpath.
    After we installed Weblogic 10.3.3, the new weblogic.jar can be found in: <WLS_HOME>\wlserver_10.3\server\lib
    However, some class files are missing and we realized we need to manually generate wlfullclient.jar and use this jar file instead.
    Reference: http://download.oracle.com/docs/cd/E12840_01/wls/docs103/client/jarbuilder.html
    The problem is that in Weblogic 10.3.3, the following class files are missing inside weblogic.jar and wlfullclient.jar
    - import weblogic.jws.Policies
    - import weblogic.jws.Policy
    Hence, our application is getting an "The import weblogic.jws.Policies cannot be resolved" error in our code.
    I look inside both weblogic.jar and wlfullclient.jar, weblogic.jws.Policies and weblogic.jws.Policy cannot be found.
    This is not an issue in Weblogic 10.3.2. These two classes can be found in wlfullclient.jar
    Any idea where I can find these class files for Weblogic 10.3.3 or something we are doing is incorrectly?
    Thanks
    Toan

    Hi,
    This missing classes can be found inside the JAR : *"E:\bea10_3_3\wlserver_10.3\server\lib\wseeclient.jar"* As well as inside *"E:\bea10_3_3\wlserver_10.3\server\lib\wls-api.jar"*
    Thanks
    Jay SenSharma
    http://weblogic-wonders.com/weblogic/webservices/ (WebLogic Wonders Are Here)

  • Deploying jre and classes without install

    i know this is a popular subject - HA!
    my red eyes have googled and forumed all they can.
    i dont want to do anything complicated.
    there is no attempt to create an .exe or write in native code.
    my question is...
    i just want to have a .bat file run a .jar file on a computer
    that does not (and can not) have java installed on it.
    can i have a .jar run on a JVM that i have - lets say -
    on the cd that includes the .jar without Java installation being required.
    and second, where are the standard imported java files
    located (like awt, swing, lang.Math...)? is it lib/tools.jar?
    so i suppose the answer extends to can the JVM run without
    being installed and if i bundle the JVM and classes how do i link
    them in my .jar?
    (from what ive read maybe through class-path in the manifest?).
    I appreciate any help!
    ai no dice

    import javax.swing.*;
    import java.awt.*;
    import java.io.*;
    public class CaptureOutput
         public static void main(String[] args) throws Throwable
              Process process = Runtime.getRuntime().exec(JOptionPane.showInputDialog("Type in the command."));
              BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream())),
                   err = new BufferedReader(new InputStreamReader(process.getErrorStream()));
              JFrame frame = new JFrame("Program Output");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.getContentPane().setLayout(new GridLayout(2,1));
              Font monospaced = new Font("Monospaced",Font.PLAIN,12);
              JTextArea inComp = new JTextArea(),
                   errComp = new JTextArea();
              inComp.setFont(monospaced);
              errComp.setFont(monospaced);
              inComp.setEditable(false);
              errComp.setEditable(false);
              inComp.append("System.out***************************************************************************************\n");
              errComp.append("System.err**************************************************************************************\n");
              frame.getContentPane().add(inComp);
              frame.getContentPane().add(errComp);
              JScrollPane scrollPane = new JScrollPane(frame.getContentPane());
              frame.setContentPane(scrollPane);
              frame.pack();
              frame.setVisible(true);
              frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
              boolean processDone = false;
              while(in.ready() || err.ready() || !processDone)
                   if(in.ready())
                        inComp.append(Character.toString((char)in.read()));
                   if(err.ready())
                        errComp.append(Character.toString((char)err.read()));
                   try
                        process.exitValue();
                        processDone = true;
                   catch(IllegalThreadStateException e)
              inComp.append("\n\nProcess exited with exit code "+process.exitValue());
    }Copy/paste that and compile it. Then run it. It will capture the output of anything you run and the input it asks for works just like the command line. That will let you see where the JRE is getting the standard classes from.
    Errrrrr..... I seriously doubt you'll be able to find someone here without Java. xD I would ask your less computer savy friends.
    I would also suggest that you just try using the public JRE instead of using the JDK's JRE. The JDK is much larger, and I wouldn't chance any errors breaking it appart could cause.
    As for running the jar, what you need to do is "java [many other options] -jar Program.jar" and have the property Main-Class set in the manifest. The "many other options" will have to be things like -bootclasspath to tell it where to look for the standard classes. This is one heck of a project you're taking on, and it will require some pretty serious understanding of how to use the VM.

  • Why the same function ToolTipText behaves differently in Jar and in Class

    Hi All! In my applet I use two similar statements from javax.swing:
    jListTeaSortSelect.setToolTipText("To stop the alarm just click over here.");
    jProgressBar1.setToolTipText("To stop the alarm just click over here.");
    Both work correctly when I run my applet from classes.
    Problem: When I run it from jar, composed from the same classes, second tool tip does not appear.
    I have no idea on where to get a hint to the solution. Could that be that the problem is caused by other graphical components or by the layout of the container?
    The applet and JAR in question with source code can be found on
    http://www.kobylkin.net/TeaTimer.htm , and the source code is included below in this letter as well..
    Thanks!
    Egor
    I do not include GNU GPL here, for histerical reasons [:-)]
    * TeaTimerJApplet.java
    * Created on 19. Januar 2002, 18:56
    * Tea timer with sound alarm to brew your tea right for the best taste.
    * Copyright Kobylkin Egor 2002. [email protected] www.kobylkin.net
    * This program is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public License
    * as published by the Free Software Foundation; either version 2
    * of the License, or (at your option) any later version.
    * This program is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    * GNU General Public License for more details.
    * You should have received a copy of the GNU General Public License
    * along with this program; if not, write to the Free Software
    * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
    USA.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.applet.*;
    import java.applet.Applet;
    import java.net.*;
    public class TeaTimerJApplet extends javax.swing.JApplet {
    /** Creates new form TeaTimerJApplet */
    public TeaTimerJApplet() {
    initComponents();
    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    private void initComponents() {//GEN-BEGIN:initComponents
    java.awt.GridBagConstraints gridBagConstraints;
    jListTeaSortSelect = new javax.swing.JList();
    jButtonTimerStart = new javax.swing.JButton();
    jProgressBar1 = new javax.swing.JProgressBar();
    getContentPane().setLayout(new java.awt.GridBagLayout());
    jListTeaSortSelect.setBorder(new
    javax.swing.border.TitledBorder("Select the tea type"));
    jListTeaSortSelect.setModel(new javax.swing.AbstractListModel() {
    String[] strings = { "Test................10sec.", "Green
    tea.........3min.", "Black tea...........4min.", "Black
    tea...........5min.", "Mint, Coffee......8min." };
    public int getSize() { return strings.length; }
    public Object getElementAt(int i) { return strings; }
    jListTeaSortSelect.setToolTipText("To stop the alarm just click
    over here.");
    jListTeaSortSelect.setName("jListTeaSort");
    jListTeaSortSelect.setSelectedIndex(2);
    jListTeaSortSelect.setSelectionBackground(java.awt.Color.yellow);
    jListTeaSortSelect.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    jListTeaSortSelect.setAutoscrolls(false);
    jListTeaSortSelect.addMouseListener(new
    java.awt.event.MouseAdapter() {
    public void mousePressed(java.awt.event.MouseEvent evt) {
    jListTeaSortSelectMousePressed(evt);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    getContentPane().add(jListTeaSortSelect, gridBagConstraints);
    jButtonTimerStart.setBackground(java.awt.Color.lightGray);
    jButtonTimerStart.setText("Start the timer");
    jButtonTimerStart.setToolTipText("<html>Visit me at
    www.kobylkin.net <br> Copyright Kobylkin Egor 2002 under GNU GPL</html>");
    jButtonTimerStart.setDoubleBuffered(true);
    jButtonTimerStart.setMaximumSize(new java.awt.Dimension(180, 90));
    jButtonTimerStart.setMinimumSize(new java.awt.Dimension(120, 27));
    jButtonTimerStart.setNextFocusableComponent(jListTeaSortSelect);
    jButtonTimerStart.setPreferredSize(new java.awt.Dimension(140,
    27));
    jButtonTimerStart.addActionListener(new
    java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jButtonTimerStartActionPerformed(evt);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    getContentPane().add(jButtonTimerStart, gridBagConstraints);
    jProgressBar1.setToolTipText("To stop the alarm signal just click
    over here.");
    jProgressBar1.setMinimumSize(new java.awt.Dimension(140, 14));
    jProgressBar1.setPreferredSize(new java.awt.Dimension(140, 14));
    jProgressBar1.addMouseListener(new java.awt.event.MouseAdapter() {
    public void mousePressed(java.awt.event.MouseEvent evt) {
    jProgressBar1MousePressed(evt);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    getContentPane().add(jProgressBar1, gridBagConstraints);
    }//GEN-END:initComponents
    private void jListTeaSortSelectMousePressed(java.awt.event.MouseEvent
    evt) {//GEN-FIRST:event_jListTeaSortSelectMousePressed
    // Add your handling code here:
    if ( timerIsRunningFlag == false )
    jListTeaSortSelect.setBackground(java.awt.Color.white);
    so.stop();
    }//GEN-LAST:event_jListTeaSortSelectMousePressed
    private void jProgressBar1MousePressed(java.awt.event.MouseEvent evt)
    if ( timerIsRunningFlag == false )
    jListTeaSortSelect.setBackground(java.awt.Color.white);
    so.stop();
    private void
    jButtonTimerStartActionPerformed(java.awt.event.ActionEvent evt)
    {//GEN-FIRST:event_jButtonTimerStartActionPerformed
    //set the controls in dumb state:
    jButtonTimerStart.setEnabled(false);
    jListTeaSortSelect.setEnabled(false);
    jListTeaSortSelect.setBackground(java.awt.Color.white);
    switch ( jListTeaSortSelect.getSelectedIndex() ) {
    case 0 : timerDelay = 500; break; //Test 10 sec.
    case 1 : timerDelay = 9000; break; //Green tea 3 min.
    case 2 : timerDelay = 12000; break; //Black tea 4 min.
    case 3 : timerDelay = 15000; break; //Black tea 5 min.
    case 4 : timerDelay = 24000; break; //Mint tea 8 min.
    // every "timerDelay/100" seconds the progress bar status will be
    set to be -5% less by timerTaskPerformer.
    // After 20 times timerDelay will be less than 5% so the
    timerTaskPerformer fires the alarm.
    timer = new javax.swing.Timer(timerDelay, timerTaskPerformer);
    timer.setRepeats(true);
    timer.start();
    timerIsRunningFlag = true;
    progressBarStatus = 100;
    jProgressBar1.setValue( progressBarStatus );
    jButtonTimerStart.setLabel("Timer started");
    so.stop();
    }//GEN-LAST:event_jButtonTimerStartActionPerformed
    private ActionListener timerTaskPerformer = new ActionListener() {
    public void actionPerformed(ActionEvent evt) {
    if (progressBarStatus > 5){ progressBarStatus-=5;
    jProgressBar1.setValue(progressBarStatus);
    }else{
    timer.stop();
    timerIsRunningFlag = false;
    //user alarm actions
    jListTeaSortSelect.setBackground (java.awt.Color.red);
    Toolkit.getDefaultToolkit().beep();
    so=getAudioClip(getCodeBase(), "spacemusic.au");
    so.loop();
    /* "Server not found" IE error.
    open pop-up explorer window to alert user
    try {
    AppletContext ac = getAppletContext();
    ac.showDocument( new URL( getCodeBase() +
    "teaReady.html" ), "_self");
    catch (MalformedURLException exc) {
    showStatus("Cannot find file teaReady.html");
    progressBarStatus = 0;
    jProgressBar1.setValue( progressBarStatus );
    //return to the initial state
    jButtonTimerStart.setText("Start the tea timer");
    jButtonTimerStart.setEnabled(true);
    jListTeaSortSelect.setEnabled(true);
    //Variables declaration
    private int progressBarStatus = 100;
    public boolean timerIsRunningFlag = false;
    public int timerDelay;
    private javax.swing.Timer timer;
    public AudioClip so;
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonTimerStart;
    private javax.swing.JList jListTeaSortSelect;
    private javax.swing.JProgressBar jProgressBar1;
    // End of variables declaration//GEN-END:variables

    Hi
    What i understand from u'r problem is that when a jar is created and run under browser, ToolTipText for progress panel is not shown? is so is the case - i had no problems..
    The code given was compiled and created a jar successfully..
    this is how i created the jar..(under WindowsNT and MSIE)
    jar cf TeaTimer.jar TeaTimerJApplet.class
    TeaTimer.html
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <META NAME="Generator" CONTENT="EditPlus">
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Description" CONTENT="">
    </HEAD>
    <BODY BGCOLOR="#FFFFFF">
    <APPLET CODE="TeaTimerJApplet" archive="TeaTimer.jar" WIDTH="200" HEIGHT="200">
    </APPLET>
    </BODY>
    </HTML>
    cheers
    Mohan

  • How to install the struts-el jar and tld file

    How can i install/configure the struts-el jar and struts-logic-el.tld. When I tried with the related sites, i couldn't get any jar files for struts-el tag.
    I got only 404 status error.
    From where and how to get the jar file and tld file for the struts-el tag .Please refer me

    The jar file is part of the download of struts.
    its in the /contrib/lib directory
    You should need struts, jstl plus the struts-el jar files.
    The tld files should not be necessary - just use the standard URIs for them.
    eg http://struts.apache.org/tags-logic-el

  • Load Jar and access a class in jar at run time

    I need help from you.
    How to load a Jar and access a class in the jar at run time?
    When i try the following code it works fine while running in Java (Jdk1.5).If iam running the same code in servlet,ClassCastException occurs.
    Error Message : ClassCastExcption : jartest1 cannot be cast to Thing
    test.jar contains jartest.class and Thing.class
    jartest1.java
    try{
    File file =new File("test.jar");
    String lcStr ="jartest";
    URL jfile = new URL("jar", "", "file:" + file.getAbsolutePath() +"!/");
    URLClassLoader cl = URLClassLoader.newInstance(new URL[] { jfile });
    Class loadedClass = cl.loadClass(lcStr);
    Thing t=(Thing)loadedClass.newInstance();
    t.execute();
    catch(Exception e)
    System.err.println(e);
    Thing.java
    public interface Thing
    void execute();
    jartest.java
    public class jartest implements Thing
    public void exceute()
    System.out.println("Welcome");
    Thanks and Regards
    V.Senthil Kumar
    Edited by: senthilv_sun on Dec 16, 2008 8:30 PM

    senthilv_sun wrote:
    I need help from you.
    How to load a Jar and access a class in the jar at run time?
    When i try the following code it works fine while running in Java (Jdk1.5).If iam running the same code in servlet,ClassCastException occurs.
    Error Message : ClassCastExcption : jartest1 cannot be cast to ThingPresumably we can only hope that that is a transciption error. It always helps to use copy and past actual errors and code rather than manually typing them.
    test.jar contains jartest.class and Thing.classWrong.
    The interface class and plugable class must not be in the same jar.
    A plugable interface requires two components
    - Interface (generic sense)
    - Functional components.
    The Interface must be independant (own jar) so that it is available to the framework (user of plugin) and to the functional components. And the plugable component must not be on the java class path.
    This also means that we know for certain that the plugable component is also on the system class path. That is a bad idea as well.
    Given that it is pretty pointless to even speculate as to why this error is showing up. Create the correct jar layout. Test using the command line. Then test using servlets. Insure that the plugable jar is NOT on the java classpath for both tests.

  • Java classes in Jar and Cab files

    Hello all,
    Our product supply java classes in Jar and Cab files that the browser downloads each time.
    The files are big and it takes a long time.
    Do you know of a way to make the cab/jar files be copied in to the user computer and that the browser would know to download files again only if there is a new version (otherwise take it from the local computer)
    Please help me
    Tamg

    I think I've seen an option for this with manifest files (or was it something that had to do with the java plug-in). There was something about the version and only download a new version if it was newer than the one on your local computer. This version thing is something you define in the manifest file at least. Take a look at jar and manifest files, there might be something there.

  • Trying to use the classes in casStubs.jar and get crawl metrics

    I was going through the class files available in casStubs.jar and was trying to come up with a script in AppConfig.xml to connect to the CAS server and obtain the crawl status and metrics. I was trying this option because the class com.endeca.eac.toolkit.component.cas.ContentAcquisitionServerComponent does not provide me these features.
    +<script id="CheckCrawlStatus">+
    +<bean-shell-script><![CDATA[+
    import javax.xml.namespace.QName;
    import com.endeca.cas.wsdl.*;
    final String wsdlUrl = "http://" "${cas.host}" + ":" + "${cas.port}" + "/cas?wsdl";+
    final QName name = new QName("http://endeca.com/itl/cas/2010-07", "CasCrawlerService");
    CasCrawlerServiceLocator service =  new CasCrawlerServiceLocator(wsdlUrl, name);
    CasCrawler crawler = service.getCasCrawlerPort();
    String crawlName = "myFirstCrawl";
    CrawlId crawlId = new CrawlId(crawlName);
    Metric[] metricArray = crawler.getMetrics(crawlId);
    + // rest of the code to retrieve crawl metrics +
    +]]></bean-shell-script>+
    +</script>+
    Unfortunately, I am always getting connection refused exception - "java.net.ConnectException: Connection refused". My cas wsdl is loading fine in my browser.
    Any ideas about the shortcomings in the code or missing configuration in CAS or DT or platformservices?
    Thanks
    Dev

    Hey Brett,
    Awesome, it works now. I went through the source code by de-compiling the class files and figured out why you referred to this extra line of code; great that it didn't miss your "laser eyes". It was really helpful.
    Another question for you; a stupid one maybe -
    I was also trying to call the web-services through the browser -
    http://{cas-host}:{cas-port}/cas/listCrawls - this one works great; gives me the list of all the crawls
    http://{cas-host}:{cas-port}/cas/getAllMetrics - this one work great too
    But when I try to pass a parameter my service call fails with an exception
    http://{cas-host}:{cas-port}/cas/getMetrics?crawlId={crawl-id}
    <soap:Body>
    <soap:Fault>
    <faultcode>soap:Server</faultcode>
    <faultstring>java.lang.ClassCastException@1b3bf979 while invoking public java.util.List com.endeca.itl.service.CasCrawlerImpl.getMetrics(com.endeca.itl.cas.api.CrawlId) throws com.endeca.itl.cas.api.CrawlNotFoundException with params {crawl-id}.</faultstring>
    </soap:Fault>
    </soap:Body>
    Note : {cas-host}, {cas-port} and {crawl-id} are placeholders for actual values.
    Any idea where I am going wrong?
    Thanks
    Dev
    Edited by: 950423 on Sep 4, 2012 3:13 PM

  • How to modify a class in .jar and compile it back

    Hi,
    I have questions reg .jar, I need to test my application and I need to modify certain files in that .jar and compile it back. How do I do that? I have extract all the classes and decompile it to .java, and I just want to edit just 1 file, but I always have problems compiling it. Am i doing it the wrong way?Please help...
    Thanks.

    Did you make a jar and now need to make changes? Help me to understand why you decomplied the class files? Can you not just make a new jar?

  • Classloader isolation and jar manifest Class-Path headers

    I have a system where I am loading a set of jars, each with its own URL classloader. So, Jar a is loaded by Loader A, jar b is loaded by Loader B, and so on.
    Each jar has a Manifest Class-Path entry declaring its dependence on other jars. So in the example above, a puts c.jar in its Class-path, and, let's say, b also puts c.jar in its Class-path, unbeknownst to a.
    Let's say there's a class Foo in c.jar. I want--need--it to be the case that (loader of a.jar == Foo.class.getClassLoader()) from the perspective of classes found in a.jar, and (loader of b.jar == Foo.class.getClassLoader()) from the perspective of classes found in b.jar.
    That is, I want a and b to have their own isolated "copies" of c.jar.
    Instead, what I'm finding is that Foo.class is loaded once, and his loader "leaks" over to the other jar's loader, if that makes any sense.
    Is there any way to accomplish what I am talking about here?
    Laird

    As I understand the question - no.Hi; I think you misunderstand the question.
    The classes are being loaded by the system loader.
    Thus there is no way to seperate them.
    If you want them seperate then you must use an
    explicit class loader to load them.I am using explicit loaders to load them. Let me try again, because I don't think I was clear.
    I have an application that has, let's say, nothing at all in its classpath. That is, it was invoked via "java ApplicationMainClass". No classpath.
    Now that application reads, let's say, a properties file containing a list of URLs that point to jars.
    Now the application creates a new URLClassLoader for each such URL. So if the mythical properties file has ten lines, then I create ten classloaders, each of which points to one and only one URL.
    My problem is, even classes loaded by these isolated, separate classloaders are "leaking" across to other loaders. Remember, the parent classloader of all of these classloaders can't see the jars. Its classpath was empty, remember?
    The issue is that the findLoadedClass() method of java.lang.ClassLoader scans the whole VM to see if a given Class was loaded before, and if it was, then by default that Class is simply returned. But I don't want that behavior.
    Now, I also don't want the behavior of having to load the silly things off disk each and every time. So how do I retain this true multiple classloader isolation?
    Thanks,
    Laird

Maybe you are looking for

  • What is the Role of R/3 BASIS administrator in SAP-APO

    Hi can any one tell me, what is the role of a BASIS admin. in SAP-APO. Please list the responsibilities.  Thanks in advance. Regards, bompally.

  • Page Total for a Column in JSF HtmlDataTable

    Hi All, I need an example to calculate page total for price column in HtmlDataTable. Each page displays 10 rows and there are 50 rows hence 5 pages in datatable.How to calculate page total after displaying the rows on page. Thanks in advance.

  • Allow users to download mp3

    In other words, I want to write the word "download," and have the mp3 transfer to the desktop (or wherever) of the clicker. I am working on a site primarily for people using screen readers and they generally do NOT use mice, so no right and left clic

  • Huawei E173 mobile broadband modem install - lost access to Internet

    A few days ago I purchased the Huawei E173 mobile broadband USB modem ("Internet Stick") with SIMcard from Tchibo; they use the 3G+ network (HSPA/UMTS) from O2 in Germany.  I installed the modem with its "Mobile Partner" GUI in WinXP/SP3 on my Asus E

  • IPOD et vidéo

    Bonjour Quelqu'un pourrait-il m'apporter une réponse au problème suivant : je ne réussis pas à charger de la vidéo sur l'IPOD que je viens d'acquérir (ipod vidéo 60 Go). Je traville sous windows XP; je souhaite charger un fichier en .avi (taille 1 GO