PLz Help New To Java

Hey im brand new to java and i just downloaded and installed jdk-1_5_0_01-windows-i586-p now im tryin to set up the PATH permanently but i have no clue how to i went to the install notes and typed in C:\Program Files\Java\jdk1.5.0_<windows>\bin in the command.com but everytime i do it says access is denied. i have no clue how to set up the path permanently beside what i tried plz help!!!

You didn't which OS you are running, but it's fairly similar for all windows.
Start->settings->control panel->system->advanced->environment variables
Go to System variables, click on path, click edit button and add a semicolon and the path at the end. DO NOT REPLACE EVERYTHING THAT'S THERE NOW.
I don't have 1.5 installed on this computer, but I'm willing to bet the real path doesn't have '<windows>' in it. Use Windows Explorer to find out where java.exe actually exists on the hard disk and use that path

Similar Messages

  • Plz help to install java plug-ins

    hi everybody,
    i am new to the world of java, i want to install java plug-ins in mozilla 1.7 on redhat linux 9.
    how to do it, plz help, thanx in advance..

    If Java was installed prior to Mozilla, it should have automatically installed.
    If not, or Mozilla was installed first, use these instructions from Mozilla:
    http://plugindoc.mozdev.org/linux.html

  • Plz help with a java app

    Dear experts,
    I have a java application in form of a running thread that periodically does an activity ie running a BAPI in
    SAP.I like to schedule this application at evening time.
    Problem is that incase somebody remotely login to this Windows server using RDP and leave an open RDP session,
    two instance starts one on RDP and other on console.
    Now to overcome this problem i devised a solution myself that incase application detects session is remote
    then it should exit itself. This is mentioned in forum undergiven.
    http://forums.sun.com/thread.jspa?threadID=5410674&messageID=10835701#10835701
    My perception behind carrying out this development was that incase session starts in remote then
    app will automatically close and finally letting running only in console.
    Now what happens is that scheduled task doesnot start at all on console ,incase console as well as RDP are open.
    Instead it starts only on RDP failing instantly.So in nutshell,task doesnot start at all.My app log say that
    service tried to open in remote session and got closed.Plz help as i have no way out.
    My second question is that if i schedule task using RDP on remote server,will it run on Remote,console or both
    of them.
    Regards,
    Aditya.

    Adi1000 wrote:
    My app also generates a .lock file and make sure that only one instance is running.Still problem remains unresolvedAnd combining your other thread with the word "also" from this post just exacerbates your "problem". Also, the "lock" file was not to prevent two simulteneous runs (that leads to very distasteful race condition), but rather to prevent two runs within a set period of time when combined with the ServerSocket approach to prevent simulteneous runs.

  • Plz help new

    I recently purchased a ringtone..I think it downloaded cause the money is missing from my account. It's not in my sounds like my husbands is. I am very new to this I went from android to iphone my first one...fell stupid but long story short purchased a ringtone money gone but no ringtone any advice would be gladly taken in this field an others to help a newbie out thank you.....Zoe

    You didn't which OS you are running, but it's fairly similar for all windows.
    Start->settings->control panel->system->advanced->environment variables
    Go to System variables, click on path, click edit button and add a semicolon and the path at the end. DO NOT REPLACE EVERYTHING THAT'S THERE NOW.
    I don't have 1.5 installed on this computer, but I'm willing to bet the real path doesn't have '<windows>' in it. Use Windows Explorer to find out where java.exe actually exists on the hard disk and use that path

  • Plz help me in java bean

    i placed my class file in
    [red] web-infclasses/user/UserData.class
    [\red]but this error can any body help me
    org.apache.jasper.JasperException: /SaveName.jsp(2,0) File "/classes.user.UserData" not found
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
         org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
         org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88)
         org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:334)
         org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:367)
         org.apache.jasper.compiler.Parser.parseDirective(Parser.java:468)
         org.apache.jasper.compiler.Parser.parseElements(Parser.java:1426)
         org.apache.jasper.compiler.Parser.parse(Parser.java:133)
         org.apache.jasper.compiler.ParserController.doParse(ParserController.java:216)
         org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
         org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:167)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    note The full stack trace of the root cause is available in the Apache Tomcat/6.0.13 logs.

    change your classpath

  • Plz help me I'm new to java

    I've created simple data base in sql and a simple html page,here is the code:
    <%@ page import="java.util.*" import="java.sql.*" %>
    <%!
    private String emp_code, emp_name, emp_dept, emp_title, emp_doj, emp_dob;
    private String error, info, create;
    private short age;
    private Statement stmt;
    %>
    <%
    //load the JDBC driver
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection conn = DriverManager.getConnection("jdbc:odbc:Master","","");
    Statement s = conn.createStatement();
    s.executeUpdate("insert into employee_info values('" + emp_code + "', '" + emp_name + "','" + emp_dept + "','" + emp_title + "', '" + emp_doj + "','" + emp_dob + "') ");
    System.out.println ("It has been successfully added");
    %>
    <HTML>
    <HEAD>
         <TITLE> ---: New Employee Information :--- </TITLE>
    </HEAD>
    <BODY>
    <DIV ALIGN="center">
         <H2> New Employee Information </H2></DIV>
    <DIV ALIGN="center">
         <p> � </p></DIV>
         <FORM METHOD = "POST" ACTION = "NewEmp.jsp">
    <H4>Employee Code: <INPUT TYPE= "text" NAME = "first1" SIZE = "17">����
    Name: <INPUT TYPE = "TEXT" NAME = "first" SIZE = "51">�������
    <font size="3">Title:�<SELECT name="Grade">
    <OPTION SELECTED> - Select -
    <OPTION >Programmer
    <OPTION >Technetion
    <OPTION>System Analyst
    <OPTION>Network Administrator
    </SELECT>�</font>
              </H4>
    <H4><font size="3">�</font>
              </H4>
    <H4><font size="3">Department Code:�</font><select name="Dept">
    <OPTION SELECTED> - Select -
    <OPTION >IT
    <OPTION >Admin
    <OPTION>MGM
    <OPTION>CSD
    <OPTION>SM
    <OPTION>FIN
    </SELECT>
    ��������
    <font size="3"><b>DOB: </b> </font> <INPUT TYPE = "TEXT" NAME = "first2" SIZE = "18">������
    <b><font size="3">DOJ: </font></b><INPUT TYPE = "TEXT" NAME = "first3" SIZE = "18">
              </H4>
    <p>�
              </p>
    <P align="center">
    <INPUT TYPE = "SUBMIT" VALUE = "Submit">     
    <INPUT TYPE = "RESET">
    <input type="button" value="Cancel" name="Cancel" onClick='javascript:window.close();'> </FORM>
    <p align="center">�</p>
    </BODY>
    </HTML>
    But I couldn't complete it or make the connection to the database, I want to fill in the blanks and then add it to the data base.
    My database name is doctrak and the table name is employee_info and below the design of the table :
    emp_code     char     10
    emp_name char     30     
    emp_dept     char     15     
    emp_title     char     10     
    emp_doj     datetime     8     
    emp_dob     datetime     8     
    I've installed the apatchi tomcat 401 and make the java environment.
    So plz can any one help me in that?
    Thanks

    But I don't know how to handel the code, I didn't
    study JSP or Java. I'm trying to learn it by doing
    this, so please can you write the code for me in jsp
    and how to put it in html then , how to do the
    connection to my database?Iam sorry to disappoint you, but no.
    If you are new to java and jsp taking up such a task to learn it is not ideal, nor
    viable. I would suggest you learn the basics of the language first, then the basics
    of jsp, then some jdbc and finally graduate to the example in question. There are
    excellent tutorials avbl for all on the net.
    Maybe someone else would even post the code here, but suggest you dont
    waste time waiting on it.
    All the best.
    Cheers,
    ram.

  • PLZ help me out i'm very new and confused to java

    Hi~
    I'm very new to java and I just brought a phone (Nokia 6670). It's capable of J2ME, as it says in the instrusction book, but I'm not so sure which Java to download. (THERE ARE SO MANY). Please help me out, I'm not sure what to do, since I'm putting games in Java.

    you want to develop your own game or just want to have some games on your new device?
    your phone has java runtime already, and that's all you need to run java games .. you can download them from several locations
    if you want to develop your own game then download Sun's J2ME Wireless Toolkit; also have a look at Nokia Developer's Suite and emulator for your device...

  • Plz help using ms access as database,i want to create a login page in java

    hye frnz... plz help me m new to java
    m using ms access as database and try to create a login page where user type username and pw
    i had enter valid user entries in database i checked connectivity is working i want as user login the main window must open after checking username and pw field to database but
    now there is an error class not found exception sun:jdbc...... error
    plz help me i had stuck frm 4 days */
    import java.sql.DriverManager;
    import java.sql.Connection;
    import java.sql.Statement;
    import java.sql.ResultSet;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class Login extends JFrame
    //Component Declarations
    JLabel jlb1,jlb2;
         JTextField jtf1;
         JPasswordField jpf1;
         JButton jb1,jb2;
         //Constructor
         Login()
         //frame settings
              setTitle("Login Dialog");
              setLayout(new GridBagLayout());
              GridBagConstraints gbc = new GridBagConstraints();
              setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
              Dimension d= Toolkit.getDefaultToolkit().getScreenSize();
              setBounds(d.width/2-175,d.height/2-100,350,200);
              gbc.insets=new Insets(7,7,7,7);
         //adding components
              jlb1=new JLabel("User ID");
              gbc.gridx=0;
              gbc.gridy=0;
              add(jlb1,gbc);
              jlb2=new JLabel("Password");
              gbc.gridx=0;
              gbc.gridy=1;
              add(jlb2,gbc);
              jtf1=new JTextField(10);
              gbc.gridx=1;
              gbc.gridy=0;
              add(jtf1,gbc);
              jpf1=new JPasswordField(10);
              gbc.gridx=1;
              gbc.gridy=1;
              add(jpf1,gbc);
              jb1=new JButton("Login");
              gbc.gridx=0;
              gbc.gridy=2;
              add(jb1,gbc);
              jb1.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent ae)
                   Connection conn=null;
                        Statement stmt=null;
                        boolean found=false;
                   try
                             Class.forName("sun.jdbc.driver.JdbcOdbcDriver");
                             String dataSourceName = "Inventory";
                             String dbURL = "jdbc:odbc:" + dataSourceName;
                             conn=DriverManager.getConnection(dbURL, "","");
                             stmt=conn.createStatement();
                             ResultSet rst=stmt.executeQuery("Select * from User");
                             System.out.println(jtf1.getText()+"/t"+jpf1.getPassword());
                             while(rst.next())
                                  System.out.println( rst.getString(1) +"/t"+ rst.getString(2));
              if(jtf1.getText().equals(rst.getString(1).trim()) && new String(jpf1.getPassword()).equals(rst.getString(2).trim()))
                                       found=true;
                                       rst.close();
                                       dispose();
                                       MainWindow mw= new MainWindow();     /*created min window object created to be opend after login but not working*/     
                                       break;
                             rst.close();
                             stmt.close();
                             conn.close();                    
                        catch(ClassNotFoundException e){System.out.print(e);}
                        catch(Exception e){System.out.print(e);}
                        if(found==false) /*this portion is executing and dialog box appears invalid name and pw with class not found exception sun:jdbc.......on console */
                             JOptionPane.showMessageDialog(null,"Invalid username or password",
                                  "Error Message",JOptionPane.ERROR_MESSAGE);
              jb2=new JButton("Clear");
              gbc.gridx=1;
              gbc.gridy=2;
              add(jb2,gbc);
              jb2.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent ae)
                        jtf1.setText("");
                        jpf1.setText("");
                        jtf1.requestFocus();
              setSize(350,200);
              setVisible(true);
              jtf1.requestFocus();
         public static void main(String args[])
    Login l=new Login();
    Edited by: 795772 on Sep 19, 2010 4:44 AM

    795772 wrote:
    hye frnz... plz help me m new to java
    m using ms access as database and try to create a login page where user type username and pw
    i had enter valid user entries in database i checked connectivity is working i want as user login the main window must open after checking username and pw field to database but
    now there is an error class not found exception sun:jdbc...... error
    plz help me i had stuck frm 4 days */
    <snip>The subject of this forum is Oracle databases. How does your problem relate to that subject?
    Two bits of advice:
    1) Make sure you ask questions in a forum related to your problem.
    2) If you want to be taken seriously as a professional, drop the MS IM Speak and use the language of the forum. In this forum it is English, which is successfully used by many people for whom English is far from their native language.

  • How can  I access my java class file in a .jar file ...PLz Help anyone!!

    Hi Folks,
    I am new in Java programming, have a .jar file that contains .java files that I want no access and use from another .java file. These files in the .jar file basically form a library thus have no main-method. However I can not declare an instance of the library (in the .jar file) and use it within my program.
    Plz help ...I have tried all I know in vain.
    Thanks.

    temba wrote:
    Hi Folks,
    I am new in Java programming, have a .jar file that contains .java files that I want no access and use from another .java file. These files in the .jar file basically form a library thus have no main-method. However I can not declare an instance of the library (in the .jar file) and use it within my program. You are making little sense. You can't instantiate .java files.
    Plz help ...I have tried all I know in vain.
    Thanks.Could you post WHAT you have tried and also post what error messages you received?

  • How to use padding scheme FIPS81 in java plz help?

    Plz refer the below code using this code I m trying to decrypt XLS file using pass phrase.
    I m using the same pass phrase which was used @ the time of encryption.
    But the problem I m facing is that the file was encrypted in DOT NET_ using padding scheme FIPS81 and there impelmentation of FIPS81 is not available in JAVA so that it gives exception at the time of decryption which is given below
    Exception : javax.crypto.BadPaddingException: Given final block not properly padded
    I urgently need the solution of this problem so somebody plz help me to find the solution of this problem.....Ur reply would be appriciated.....!!
    The File is Encrypted using below mechanism
    ALGORITHM : AES
    MODE : ECB
    PADDING SCHEME : FIPS81
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.UnsupportedEncodingException;
    import java.security.MessageDigest;
    import java.security.NoSuchAlgorithmException;
    import javax.crypto.*;
    import javax.crypto.spec.*;
    public class DecryptTest {
         public static void main(String[] s){
              String passPhrase = "passphrase";
              String encFileName = "encsample.xls";
              String decFileName = "decsample.xls";
              FileInputStream encFileIn = null;
              FileOutputStream decFileOut = null;
              File f = null;
              byte[] message;
              try {
                   f = new File(encFileName);
                   encFileIn = new FileInputStream(f);
                   decFileOut = new FileOutputStream(decFileName);
                   message = new byte[encFileIn.available()]; //Read the encrypted file in from disk
                   encFileIn.read(message);
                   SecretKeySpec spec = new SecretKeySpec(passwordToKey (passPhrase), "AES");
                   //decrypt it
                   Cipher c = Cipher.getInstance("AES/ECB/NoPadding");
                   c.init(Cipher.DECRYPT_MODE, spec);
                   System.out.println("Block Size is >-->" + c.getBlockSize());
                   String decryptedString = new String(c.doFinal(message));
                   System.out.println("Decrypted message: " + decryptedString);
                   //To write into another files
                   decFileOut.write(decryptedString.getBytes());
              }catch (Exception e) {
                   System.out.println(e);
              }finally {
                   try {
                        encFileIn.close();
                        decFileOut.close();     
                   } catch (IOException ioe) {
         }Is there any mechanism is available for FIPS81 or Is there any third party Provider available for it plz reply........????????

    I suggest you look in google http://www.google.co.uk/search?q=SWF+java

  • Java Mail Project HELP Required....URGENT PLZ HELP!!!

    hello there!!
    i took up a pjct for my engineering on java mail..got the code..and i thought that ill analyse it...the code is submitting the mail to the smtp server but after dat its failing to deliver to the client..as i can see this error in the logs on SMTP server...can anyone help me out in analysing this code!!!
    plz help, exams are near...(am new to java)
    //java FINAL!
    import javax.swing.*;
    import java.net.URL;
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    public class EmailProg extends JPanel implements ActionListener {
    protected JTextArea textArea;
    protected String newline = "\n";
    static final private String composemail = "compose";
    static final private String sendmail = "send";
    static final private String about = "about";
    static final private String submit = "submit";
    static final private String exit = "exit";
    JLabel lSubmit = new JLabel("Submit");
    JButton subbutton = new JButton();
    JTextArea emailfrom = new JTextArea(1,1);
    JTextArea emailto = new JTextArea(1, 1);
    JTextArea emailsubject = new JTextArea(1, 1);
    JTextArea emailmessage = new JTextArea(25, 1);
    //------BAG LAYOUT
    JLabel lFrom = new JLabel("From:");
    JTextField cFrom = new JTextField(32);
    JLabel lTo = new JLabel("To:");
    JTextField cTo = new JTextField(32);
    JFrame frame2 = new JFrame("Compose New");
    JLabel lSubject = new JLabel("Subject");
    JTextField cSubject = new JTextField(32);
    JLabel lMessage = new JLabel("Body");
    JTextArea cMessage = new JTextArea(5,32);
    //====================================
    public EmailProg() {
    super(new BorderLayout());
    //Create the toolbar.
    JToolBar toolBar = new JToolBar();
    addButtons(toolBar);
    //Create the text area used for output. Request
    //enough space for 5 rows and 30 columns.
    textArea = new JTextArea(5, 30);
    textArea.setEditable(false);
    textArea.setText("Welcome to Jeff's email program! With this program you can compose and send emails. I hope I get a good grade on thise, and marine world finds a good use for it :-D:-D (implements really just testing the scroller!!!)");
    JScrollPane scrollPane = new JScrollPane(textArea);
    //Lay out the main panel.
    setPreferredSize(new Dimension(450, 110));
    add(toolBar, BorderLayout.NORTH);
    add(scrollPane, BorderLayout.CENTER);
    //==================================
    protected void addButtons(JToolBar toolBar) {
    JButton button = null;
    //first button
    button = makeNavigationButton("/toolbarButtonGraphics/general/ComposeMail24.gif", composemail ,"Compose new Email", "compose new");
    toolBar.add(button);
    //second button
    button = makeNavigationButton("toolbarButtonGraphics/general/SendMail24.gif", sendmail,"Send The Mail","send");
    toolBar.add(button);
    //third button
    button = makeNavigationButton("toolbarButtonGraphics/general/About24.gif", about,"About","About");
    toolBar.add(button);
    //exit button
    button = makeNavigationButton("toolbarButtonGraphics/general/Stop24.gif", exit, "Exit", "Exit");
    toolBar.add(button);
    //===================================
    protected JButton makeNavigationButton(String imageName, String actionCommand, String toolTipText, String altText) {
    //Look for the image.
    String imgLocation = imageName;
    URL imageURL = EmailProg.class.getResource(imgLocation);
    //Create and initialize the button.
    JButton button = new JButton();
    button.setActionCommand(actionCommand);
    button.setToolTipText(toolTipText);
    button.addActionListener(this);
    if (imageURL != null) {                      //image found
    button.setIcon(new ImageIcon(imageURL));
    } else {                                     //no image found
    button.setText(altText);
    System.err.println("Resource not found: "+ imgLocation);
    return button;
    //=============================
    public void actionPerformed(ActionEvent e) {
    String cmd = e.getActionCommand();
    String description = null;
    // Handle each button.
    if (exit.equals(cmd)){
    textArea.setText("");
    description = "EXITING";
    System.exit(0);
    if (composemail.equals(cmd)) { //first button clicked
    textArea.setText("");
    description = "Write new mail.";
    composeWindow();
    } else if (sendmail.equals(cmd)) { // second button clicked
    textArea.setText("");
    description = "This button does'nt do anything yet :x";
    } else if (about.equals(cmd)) { // third button clicked
    textArea.setText("");
    description = "About this program. (See pop-up)";
    coolWindow();
    else if (submit.equals(cmd))
    if (cFrom.getText().equals("")||cTo.getText().equals("")||cSubject.getText().equals("")||cMessage.getText().equals(""))
    textArea.setText("One or more of the fields was not filled in.");
    else{
    try {
    String smtpServer="serverhere";
    String to=cTo.getText();
    String from=cFrom.getText();
    String subject=cSubject.getText();
    String body=cMessage.getText();
    send(smtpServer, to, from, subject, body);
    textArea.setText("");
    description = "Mail Sent.";
    JOptionPane.showMessageDialog(null, "Message Sent.");
    catch (Exception ex)
    System.out.println("Usage: java com.lotontech.mail.SimpleSender"
    +" smtpServer toAddress fromAddress subjectText bodyText");
    //CLOSE THE FRAME2 WINDOW IIIIIIIIFFFFFFF SENDING IS SUCCESSFUL!!
    }//end of else during send
    }//end of if of submit
    displayResult(description);
    //============================
    protected void displayResult(String actionDescription) {
    textArea.append(actionDescription + newline);
    //=============================
    public void coolWindow() {
    JFrame frame = new JFrame("About");
    JTextArea filecontents = new JTextArea();
    filecontents.setText("Use the tool bar to compose\n compose new emails, in which you can\n send to anyone on the\n srvhs email server. \n Fill in all the blanks before pressing send. If you dont\n you will receive an error! \n For more information about this program click on the\n information button.");
    frame.getContentPane().add(filecontents, BorderLayout.CENTER);
    frame.pack();
    frame.setResizable(false);
    frame.setSize(300,200);
    frame.setVisible(true);
    //===============================
    public void composeWindow() {
    frame2.getContentPane().setLayout(new GridBagLayout());
    frame2.setResizable(false);
    frame2.setSize(600,500);
    frame2.setVisible(true);
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.insets = new Insets(5, 10, 5, 10);
    cMessage.setLineWrap(true);
    subbutton = makeNavigationButton("toolbarButtonGraphics/general/SendMail24.gif", submit,"submit","submit");
    addRow(gbc, lFrom, cFrom);
    addRow(gbc, lTo, cTo);
    addRow(gbc, lSubject, cSubject);
    addRow(gbc, lMessage, cMessage);
    addRow(gbc, lSubmit, subbutton);
    //===============================
    private void addRow(GridBagConstraints gbc, Component left, Component right) {
    gbc.gridx = GridBagConstraints.RELATIVE;
    gbc.gridy = GridBagConstraints.RELATIVE;
    gbc.gridheight = 1;
    gbc.gridwidth = 1;
    gbc.anchor = GridBagConstraints.EAST;
    frame2.getContentPane().add(left, gbc);
    gbc.gridwidth = GridBagConstraints.REMAINDER;
    gbc.anchor = GridBagConstraints.WEST;
    frame2.getContentPane().add(right, gbc);
    frame2.pack();
    //=======================
    public static void send(String smtpServer, String to, String from, String subject, String body) {
    try {
    Properties props = System.getProperties();
    props.put("localhost", smtpServer);
    Session session = Session.getDefaultInstance(props, null);
    System.out.println(smtpServer);
    // -- Create a new message --
    Message msg = new MimeMessage(session);
    // -- Set the FROM and TO fields --
    msg.setFrom(new InternetAddress(from));
    msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(to, false));
    // -- We could include CC recipients too --
    // if (cc != null)
    // msg.setRecipients(Message.RecipientType.CC
    // ,InternetAddress.parse(cc, false));
    // -- Set the subject and body text --
    msg.setSubject(subject);
    msg.setText(body);
    // -- Set some other header information --
    msg.setHeader("X-Mailer", "LOTONtechEmail");
    msg.setSentDate(new Date());
    // -- Send the message --
    Transport.send(msg);
    System.out.println("Message sent OK.");
    catch (Exception ex)
    ex.printStackTrace();
    public static void main(String[] args) {
    JFrame frame = new JFrame("EmailProg");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    EmailProg newContentPane = new EmailProg();
    newContentPane.setOpaque(true);
    frame.setContentPane(newContentPane);
    //Display the window.
    frame.pack();
    frame.setVisible(true);
    }

    The code to retrieve the messages from SMTP
    finally all working fine...
    thanx guys!!!
    package EmailProg;
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.util.*;
    import java.io.*;
      * A simple email receiver class.
    public class SimpleReceiver
        * Main method to receive messages from the mail server specified
        * as command line arguments.
      public static void main(String args[])
        try
          String popServer=args[0];
          String popUser=args[1];
          String popPassword=args[2];
          receive(popServer, popUser, popPassword);
        catch (Exception ex)
          System.out.println("Usage: java com.mail.SimpleReceiver" +" popServer popUser popPassword");
        System.exit(0);
         * "receive" method to fetch messages and process them.
       public static void receive(String popServer, String popUser, String popPassword)
         Store store=null;
         Folder folder=null;
         try
           // -- Get hold of the default session --
           Properties props = System.getProperties();
           Session session = Session.getDefaultInstance(props, null);
           // -- Get hold of a POP3 message store, and connect to it --
           store = session.getStore("pop3");
           store.connect(popServer, popUser, popPassword);
           // -- Try to get hold of the default folder --
           folder = store.getDefaultFolder();
           if (folder == null) throw new Exception("No default folder");
           // -- ...and its INBOX --
           folder = folder.getFolder("INBOX");
           if (folder == null) throw new Exception("No POP3 INBOX");
           // -- Open the folder for read only --
           folder.open(Folder.READ_ONLY);
           // -- Get the message wrappers and process them --
           Message[] msgs = folder.getMessages();
           for (int msgNum = 0; msgNum < msgs.length; msgNum++)
             System.out.println(msgs[msgNum]);
         catch (Exception ex)
           ex.printStackTrace();
         finally
           // -- Close down nicely --
           try
             if (folder!=null) folder.close(false);
             if (store!=null) store.close();
           catch (Exception ex2) {ex2.printStackTrace();
      }

  • Plz help me to close new window !  !  !  !  !  !  !

    Hi all,
    i'm a fresher in jsp. i write a jsp page with a 'text box' & a button. when i click the button, i want to see the html page that can choose somthing from it & then, i want to see the selected data in the 'text box' of jsp page of previous window. but, when i run my code, the jsp page open, then when i click the button, the html page appear with new window. but, when i choose one & click the submit button, it call the jsp page again in new window. i don't want to see the jsp page again in new window. but in previous window with the data i selected in the 'text box'.
    How can i do it? where can i change?
    Plz help me.
    Here my coding ..........
    \\\\\\\\\\ 13p3.jsp \\\\\\\\\\\\\\\\\\\\\\
    <%@ page language="java" info="form processing page" %>
    <html>
    <head><title></title></head>
    <body>
    <%! String sid; %>
    <%
    sid = request.getParameter("id");
    %>
    <input type="text" name="ID" size=20 value=<%= sid %>>
    <%= sid %>
    <input type="button" name="ControlButton" value="Start." onClick="window.open('13p2.html','ControlWindow','width=250, height=225')">
    </body>
    </html>
    \\\\\\\\\\\\\ 13p2.html \\\\\\\\\\\\\\\\\
    <html>
    <head><title></title></head>
    <body>
    <form method=post action="13p3.jsp">
    <table width=100% border=2 bordercolor=#00ffdd>
    <tr><td colspan=2>
    <table bgcolor=#A5A6C6#00ffdd width=100%><td width=50%><center>ID</center></td><td width=50%><center>Name</center></td></table>
    </td></tr>
    <tr><td width=50%><center><input type=radio name="id" value=1>1</center></td><td width=50%>Ma The The</td></tr>
    <tr><td width=50%><center><input type=radio name="id" value=2>2</center></td><td width=50%>Ma Mar Mar</td></tr>
    <tr><td width=50%><center><input type=radio name="id" value=3>3</center></td><td width=50%>Ma Mie Mie</td></tr>
    </table>
    <table width=100% border=0>
    <tr><td width=100%><center><input type=submit value=Submit></center></td></tr>
    </table>
    </form>
    </body>
    </html>
    \\\\\\\\\\End
    thanks ...
    icyrock.

    This isn't a JSP problem. Brush up on your Javascript.

  • Convert C++ prog into Java( I m new in java)help urgent

    hi all,
    i am very new in java. i have code of C++.i have to convert it in to Java.please help me on urgent basis.plz provide me solution.
    I am looking for positive response.code is below:
    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    #include <sys/stat.h>
    #include <fstream.h>
    #include <iostream.h>
    //#include <sha.h> //24112003
    //#include<wincrypt.h>
    char ntc(unsigned char n){
    if (n<26) return 'A'+n;
    if (n<52) return 'a'-26+n;
    if (n<62) return '0'-52+n;
    if (n==62) return '+';
    if (n==63)return '/';
    unsigned char ctn(char c){
    if (c=='/') return 63;
    if (c=='+') return 62;
    if ((c>='A')&&(c<='Z')) return c-'A';
    if ((c>='a')&&(c<='z')) return c-'a'+26;
    if ((c>='0')&&(c<='9')) return c-'0'+52;
    if (c=='~') return 80;
    return 100;
    int b64decode(char from,char to,int length){
    unsigned char c,d,e,f;
    char A,B,C;
    int i;
    int add;
    char *tot=to;
    for (i=0;i+3<length;){
    add=0;
    A=B=C=0;
    c=d=e=f=100;
    while ((c==100)&&(i<length)) c=ctn(from[i++]);
    while ((d==100)&&(i<length)) d=ctn(from[i++]);
    while ((e==100)&&(i<length)) e=ctn(from[i++]);
    while ((f==100)&&(i<length)) f=ctn(from[i++]);
    //if (f==100) return -1; /* Not valid end */
    if (c<64) {
    A+=c*4;
    if (d<64) {
    A+=d/16;
    B+=d*16;
    if (e<64) {
    B+=e/4;
    C+=e*64;
    if (f<64) {
    C+=f;
    to[2]=C;
    add+=1;
    to[1]=B;
    add+=1;
    to[0]=A;
    add+=1;
    to+=add;
    if (f==80) return to-tot; /* end because '=' encountered */
    return to-tot;
    int b64get_encode_buffer_size(int l,int q){
    int ret;
    ret = (l/3)*4;
    if (l%3!=0) ret +=4;
    if (q!=0){
    ret += (ret/(q*4));
    /* if (ret%(q/4)!=0) ret ++; */ /* Add space for trailing \n */
    return ret;
    int b64strip_encoded_buffer(char *buf,int length){
    int i;
    int ret=0;
    for (i=0;i<length;i++) if (ctn(buf)!=100) buf[ret++] = buf [i];
    return ret;
    int b64encode(char from,char to,int length,int quads){
    // 3 8bit numbers become four characters
    int i =0;
    char *tot=to;
    int qc=0; // Quadcount
    unsigned char c;
    unsigned char d;
    while(i<length){
    c=from[i];
    *to++=ntc(c/4);
    c=c*64;
    i++;
    if (i>=length) {
    *to++=ntc(c/4);
    *to++='~';
    *to++='~';
    break;
    d=from[i];
    *to++=ntc(c/4+d/16);
    d=d*16;
    i++;
    if (i>=length) {
    *to++=ntc(d/4);
    *to++='~';
    break;
    c=from[i];
    *to++=ntc(d/4+c/64);
    c=c*4;
    i++;
    *to++=ntc(c/4);
    qc++; /* qz will never be zero, quads = 0 means no linebreaks */
    if (qc==quads){
    *to++='\n';
    qc=0;
    /* if ((quads!=0)&&(qc!=0)) to++='\n'; / /* Insert last linebreak */
    return to-tot;
    char* mEncryptPassword(char* mPassword)
    char mEncryptedPassword[200]; // To hold encrypted password.
    //char* mEncryptedPassword = new char[200];
    char mPrimEncryptedPassword[200];
    char * temp = new char[200];
    //unsigned char* md; // 19122003
    //md = new unsigned char[100]; // 19122003
    memset(mEncryptedPassword, '\0', sizeof(mEncryptedPassword));
    memset(mPrimEncryptedPassword, '\0', sizeof(mPrimEncryptedPassword));
    strcpy(mPrimEncryptedPassword, mPassword);
    //strcpy(mPrimEncryptedPassword, (char*) SHA1((unsigned char*) mPassword, strlen(mPassword), NULL));
    //strcpy(mEncryptedPassword, (char*) SHA((unsigned char*) mPassword, strlen(mPassword), md)); // 19122003
    //strcpy(mEncryptedPassword, (char*) SHA((unsigned char*) mPassword, strlen(mPassword), md)); //19122003
    b64encode(mPrimEncryptedPassword, mEncryptedPassword, strlen(mPrimEncryptedPassword), 0);
    // If successfully encrypts..
    if (mEncryptedPassword != NULL)
    //char * temp = new char[strlen(mEncryptedPassword)+1];
    strcpy(temp,mEncryptedPassword);
    // strcpy(mRetVal,mEncryptedPassword);
    return (char*)temp;
    //return (mEncryptedPassword);
    //return (char*) md; // 19122003
    else
    return ("Error");
    char* mDecryptPassword(char* mPassword)
    char mDecryptedPassword[200]; // To hold decrypted password.
    char mPrimDecryptedPassword[200];
    char * temp = new char[200];
    // 02032007
    memset(mDecryptedPassword, '\0', sizeof(mDecryptedPassword));
    memset(mPrimDecryptedPassword, '\0', 200);
    strcpy(mPrimDecryptedPassword, mPassword);
    b64decode(mPrimDecryptedPassword, mDecryptedPassword, strlen(mPrimDecryptedPassword));
    // If successfully decrypts..
    if (mDecryptedPassword != NULL)
    //char * temp = new char[strlen(mEncryptedPassword)+1];
    strcpy(temp,mDecryptedPassword);
    // strcpy(mRetVal,mDecryptedPassword);
    return (char*)temp;
    //return (mEncryptedPassword);
    //return (char*) md; // 19122003
    else
    return ("Error");
    void main(int argc, char* argv[])
    cout << mEncryptPassword(argv[1])<<endl<<flush;
    cout << mDecryptPassword(mEncryptPassword(argv[1]))<<endl<<flush;
    Anubhav

    endasil wrote:
    I just thought of how ridiculous this would sound in any other profession:
    Surgeons:
    plz plz help I have patient dying need to insert new kidney into 90yr old patient plz someone come do itLawyers:
    Help client guilty need good defense (I m new in law)help urgentHow come we get stuck with the lazy low-lifes?Because there's no legal requirement that a software developer must be licensed

  • New to java plz hep me

    hello all,
    i'm new to java. i need to know answers to these questions..
    1.     What is the purpose of CLASSPATH? How �classpath� is used by �java� and �javac�?
    2.     What is the purpose of finally block?
    3.     What is �Ant�?
    4.     Explain the difference between abstract class and interface. When to use an abstract class and when to use an interface?
    5.     What is the purpose of �Xms option of �java�?
    6.     What is the main difference between java.util.Date class and java.util.Calendar class?
    7.     What are the differences between wait and sleep methods?
    8.     What is the advantage of using ArrayList over Vector?
    9.     Explain the word �casting�
    could u plz help me.. i need them very much..

    1.     What is the purpose of CLASSPATH? How �classpath�
    is used by �java� and �javac�?Classpath is the paths along which javac or the jvm searches for classes to load.
    2.     What is the purpose of finally block?Cleanup if something went wrong
    >
    3.     What is �Ant�? Ant is a preprocessor, kinda like .bat files.
    >
    4.     Explain the difference between abstract class and
    interface. When to use an abstract class and when to
    use an interface?You should really google this. It's hard to answer this in 1 line
    >
    5.     What is the purpose of �Xms option of �java�?Increase the java heap size
    6.     What is the main difference between java.util.Date
    class and java.util.Calendar class?RTFM http://java.sun.com/j2se/1.5.0/docs/api/
    >
    7.     What are the differences between wait and sleep
    methods?sleep sleeps. Wait and Notify work together in multithreaded apps.
    >
    8.     What is the advantage of using ArrayList over
    Vector?It is faster
    >
    9.     Explain the word �casting�In the harry potter sense of the word?
    Object o = "hi";
    String s = (String) o;

  • Could you plz help me?!?!?!I'm NEW!!!

    Hi to everyone!
    I'm new at java,I mean that i just started learning how to program in Java and i have a problem while compiling my fisrt program in Java!
    Firstly,i have to say that i have downloaded the jre-1_5_0_04-windows-i586-p.exe and installed it in my pc.From the installation a Java folder was being created.
    I used Cygwin(an editor on my PC) in order to write the program :
    public class HelloWorldApp {
    public static void main(String args[ ]) {
    System.out.println("Hello World!");
    Then after storing the program i tried to compile it using javac and it outputted :
    user@owner ~
    $ javac HelloWorldApp.java
    bash: javac: command not found
    I tried then to use sthg else(java only,not javac) and it outputted
    user@owner ~
    $ java HelloWorldApp.java
    Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldApp/java
    Well,could you plz help me and tell me where is the problem?
    I mean that ,shall i use a different editor or sthg else?
    Thanks in advance! : )
    Good evening!!!

    Then save ur prog in bin
    folderYou should definitely not do this.
    and then compile it will surely work. Bye.You can compile it, though, after saving it to a better place. That's what the path is for. You wouldn't set the path if you were going to store everything in the bin folder.
    Instead, store it in a java specific folder under My Documents (Windows) or your home directory.

Maybe you are looking for