J2ME: jar created using Eclipse won't install..

hi
i am using following code to create this J2ME : jar package but, it doesnt gives installation error in my mobile.. :(
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class Login extends MIDlet implements CommandListener
       private Display display;
       private TextField userName,password;
       public Form form;
       private Command loginCommand, exitCommand;
       private Image img;
       public Login() {
         form = new Form("Login Screen");
         userName = new TextField("LoginID:", "", 30, TextField.ANY);
         password = new TextField("Password:", "", 30, TextField.PASSWORD);
         exitCommand = new Command("Exit", Command.EXIT, 0);
         loginCommand = new Command("Login", Command.OK, 2);
         try
           img = Image.createImage("/loginscreen.jpg");
         catch(Exception e)
           System.out.println(e.getMessage());
        public void startApp()
         display = Display.getDisplay(this);
         try{
              form.append(img);
         catch(Exception e)
         form.append(userName);
         form.append(password);
         form.addCommand(exitCommand);
         form.addCommand(loginCommand);
         form.setCommandListener(this);
         display.setCurrent(form);
       public void pauseApp()
       public void destroyApp(boolean unconditional)
         notifyDestroyed();
       public void validateUser(String name, String password)
         if (name.equals("default") && password.equals("default"))
           showMsg();
         else
           tryAgain();
       public void showMsg()
         Alert success = new Alert("Login Successfully", "Your Login Process is completed!", img, AlertType.INFO);
         success.setImage(img);
         userName.setString("");
         password.setString("");
         display.setCurrent(success, form);   
       public void tryAgain()
         Alert error = new Alert("Login Incorrect", "Please try again", img, AlertType.ERROR);
         error.setTimeout(900);
         error.setImage(img);
         userName.setString("");
         password.setString("");
         display.setCurrent(error, form);
       public void commandAction(Command c, Displayable d)
         String label = c.getLabel();
         if(label.equals("Exit"))
           destroyApp(true);
         else if(label.equals("Login"))
           validateUser(userName.getString(), password.getString());
}hello world sort J2ME applications are still working..
how to get this jar package to work?? have i made any mistake while coding it??

hello Darryl.Burke
as soon as my WTK started to emulate applications i was able to see an exception in it something like ClassNotDefined.. i understood that i named file under src as well as class in caps which was the problem .. (java is a case-sensitive language)
anyways thanks alot for all help i got from yourside..
regards
Anshul Bhatnagar

Similar Messages

  • Create jar file using eclipse including the addition of a dll

    hy ..
         i have developed an application using eclipse.Having problems exporting the file as an executable jar.Even after providing the main class name in the manifest file, the jar file is giving the following error on a double click - "Could not find main class.Program will exit" .
         i have used an external jar file for displaying a tray icon on the system tray.This inturns uses a dll file which i have on my classpath.How do i get these into the jar and get it running..
    thanx in advance

    hy ..
    i have developed an application using eclipse.Having
    g problems exporting the file as an executable
    jar.Even after providing the main class name in the
    manifest file, the jar file is giving the following
    error on a double click - "Could not find main
    class.Program will exit" .Guessing, you don't specify the package part of the classname.
    i have used an external jar file for displaying a
    a tray icon on the system tray.This inturns uses a
    dll file which i have on my classpath.How do i get
    these into the jar and get it running..You can't run a dll from inside of a jar.
    If you're trying to use the JDIC tray classes, I don't believe they will run from a jar, but you might find otherwise. See https://jdic.dev.java.net/
    >
    thanx in advance

  • Difference  between jar created using NWDS and 'java cfm'

    Hi,
    I have exported a jar file of a java application from NWDS. My question is how different it is from the jar that is been created using java cfm command ?
    Thanks,
    RPN

    Hi,
    No difference
    Regards
    Ayyapparaj

  • Menus created using manual won't link to other Pages

    Created a site and had a menu created using manual which was linked to sub pages within the site. The menu was for specific pages not requiring access from the sites top level menu.
    The menu was working but now it is not possible to edit or replace the menu as there does not seem to be any way of adding the link to the required page. The dropdown box to the side of hyperlink stays greyed out and can't be accessed. This is only happening to links added using the menu widget under manual, ordinary text links seem to be OK.

    Welcome to the Apple Discussions. Confirm that there are no objects overlaying the navbar. How did you change the background, from the Inspector/Page/Layout pane?
    Happy New Year

  • How can i create  Jar file using Eclipse IDE.

    Hi Guys
    Am new to java. I want convert my project into executable jar file.
    In my project am using itext.jar.And some other folder.
    already i create jar file.But its not working.only its working 4 modules after that its say file cannot found exception.but the file path is correct.i dont know why its happen.
    This is my project folder strutre also
    Log:->
    src(folder)
    logs(folder)
    comments(folder)
    lib-->itext.jar.
    images-->1,gif
    properties-->catconfig.properties (file)
    now can i create jar file
    this code also show error when i run the jar file
    And this is my catconfig. properties file
    fileName=total_system_log.log
    DDSingle=DD_bysingleIP_comment.txt
    DDRange=DD_byrange_comment.txt
    NDPing=ping_comments.txt
    NDFPing=fping_comments.txt
    reportFileName=report.txt
    moduleFileName=Modules.txt
    propFileName=nameDetails.properties
    Choice=DDSingle
    logFileName=DDSingleIP_10.32.0.2.log
    finalReport=FinalReport.txt
    logFilePath=\logs\
    commentFilePath=\\Comments\\
    its very urgent for me . could u pls send my error  and u r ideas.
    thanks for u r Ansewering.
    import java.io.BufferedReader;
    import java.io.DataOutputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.FileReader;
    import java.io.FileWriter;
    import java.io.InputStream;
    import java.io.RandomAccessFile;
    import java.util.Properties;
    import java.util.ResourceBundle;
    import java.util.ArrayList;
    public class LogReader {  
        public void getValuesFromFilesOnly(String Choice,String logFileName)
              try {
                   ArrayList commentsList = new ArrayList();
                   ArrayList tempList = new ArrayList();
                   String userdir = System.getProperty("user.dir");
                   String logFilePath=ResourceBundle.getBundle("catconfig").getString("logFilePath");
                   String commentDir =ResourceBundle.getBundle("catconfig").getString(Choice);
                   String commentFilePath=ResourceBundle.getBundle("catconfig").getString("commentFilePath");
                   String currentdir1 =userdir+logFilePath+logFileName;
                   StringBuffer strBuff=new StringBuffer();
                   RandomAccessFile randomFile = null;
                   RandomAccessFile commentsFile = null;
                   String tempLine = null;
                   String commentLine = null;
                   String catVersion = null;
                   String finalReport=null;
                   int colon = 0;                    
                   int counter = 0;
                   boolean startFlag = false;
                   boolean endFlag = false;                    
                   boolean endOfFileFlag = false;          
                   System.out.println("Log file checked----->"+currentdir1);
                   System.out.println("comments file used--->"+commentDir);
                   try {
                        randomFile = new RandomAccessFile(currentdir1, "r");
                   } catch (Exception e) {
                        System.out.println("exception@getValuesFromFilesOnly@begin : "+e);
                   System.out.println("hi test1");
                   String commentDir1=userdir+commentFilePath+commentDir;
                   try{
                   System.out.println("Comment Dir:"+commentDir1);
                   commentsFile = new RandomAccessFile(commentDir1, "r");
                   catch (Exception e) {
                        System.out.println("exception@getValuesFromCommentDirOnly@begin : "+e);
                   while ((commentLine = commentsFile.readLine()) != null) {                         
                        String checkLine = commentLine.substring(commentLine.indexOf("=")+1, commentLine.length());
                        String message = commentLine.substring(0,commentLine.indexOf("="));
                        commentsList.add(checkLine);
                   commentsFile.close();
                   String startComment = (String)commentsList.get(0);
                   String endComment = (String)commentsList.get(commentsList.size()-1);
                   strBuff.append("                          CAT LOG REPORT                           \n\n");
                   while ((tempLine = randomFile.readLine()) != null) {               
                        if(tempLine.contains("CAT version is :"))
                             colon = tempLine.indexOf("is :");
                             catVersion = tempLine.substring(colon+4,tempLine.length());
                             String version=tempLine;
                             strBuff.append("Version : "+catVersion+"\n");
                             System.out.println("catVersion is :"+catVersion);
                        commentsFile = new RandomAccessFile(commentDir1, "r");
                        while ((commentLine = commentsFile.readLine()) != null) {
                             String checkLine = commentLine.substring(commentLine.indexOf("=")+1, commentLine.length());
                             String message = commentLine.substring(0,commentLine.indexOf("="));
                             checkLine=checkLine.toLowerCase();
                             tempLine=tempLine.toLowerCase();
                             if(tempLine.contains(checkLine))
                                  colon = tempLine.indexOf("info -");
                                  catVersion = tempLine.substring(colon+7,tempLine.length());
                                  strBuff.append(message+" ==> "+catVersion+"\n");
                                  System.out.println(message+" ==> "+catVersion);
                                  tempList.add(message+" ==> "+catVersion);
                                  if (catVersion.contains(startComment)){
                                       startFlag = true;
                                       counter++;
                                       System.out.println("*******startFlag**********"+startFlag);
                                  if (catVersion.contains(endComment)){
                                       endFlag = true;
                                       System.out.println("*******endFlag**********"+endFlag);
                                  if (startFlag == true && endFlag == true){
                                       System.out.println("******************************************");
                                       System.out.println("-------------Successfull completion-------");
                                       System.out.println("******************************************");
                                       startFlag = false;
                                       endFlag = false;
                                       counter = 0;
                                       tempList.clear();
                                  if (startFlag == true && endFlag == false && counter > 1){
                                       System.out.println("******************************************");
                                       System.out.println("---------------Failure after-----:"+tempList.get(tempList.size()-1));
                                       System.out.println("******************************************");
                                       //startFlag = false;
                                       //endFlag = false;
                                       counter = 0;
                                       tempList.clear();
                        commentsFile.close();
                   endOfFileFlag = true;
                   if (startFlag == true && endFlag == false && endOfFileFlag == true){
                        System.out.println("******************************************");
                        System.out.println("---------------Failure after-----:"+tempList.get(tempList.size()-1));
                        System.out.println("******************************************");
                        startFlag = false;
                        endFlag = false;
                        counter = 0;
                        tempList.clear();
                   randomFile.close();
                 System.out.println("hi");
                   finalReport=ResourceBundle.getBundle("catconfig").getString("finalReport");
                   savereportFile(strBuff,finalReport);
                   System.out.println("Report Generated");
              } catch (Exception e){
                   System.out.println("Exception@getValuesFromFilesOnly : "+e);
        public void findDetails()
             String currentdir1 = ResourceBundle.getBundle("catconfig").getString("fileName");     
             String logFilePath=ResourceBundle.getBundle("catconfig").getString("logFilePath");
             String userdir = System.getProperty("user.dir");
             RandomAccessFile randomFile = null;
             StringBuffer strBuff=new StringBuffer();
             StringBuffer strBuff1=new StringBuffer();
             StringBuffer strBuff2=new StringBuffer();
             String tempLine = null;     
              String catVersion = null;
              String timeStr=null;
              String nameStr=null;
              String startIP="";
              String endIP="";
              String tempStart="";
              String tempEnd="";
              String reportFileName="";
              String moduleFileName="";
              String propFileName="";
              int startPos=0;
              int endPos=0;
              int fromIndex=0;
              boolean versionFlag=false;
              boolean ndFlag=false;
              boolean ddFlag=false;
              try {
                   randomFile = new RandomAccessFile(userdir+logFilePath+currentdir1, "r");
                   while ((tempLine = randomFile.readLine()) != null) {
                        if(tempLine.contains("CAT version is :") && !versionFlag)
                             startPos = tempLine.indexOf("is :");
                             catVersion = tempLine.substring(startPos+4,tempLine.length());
                             String version=tempLine;
                             strBuff.append("version : "+version+"\n");
                             versionFlag=true;
                             //System.out.println("version : "+version);
                        if(tempLine.contains("Inside NetworkDiscoverySlider.jsp"))
                             ndFlag=true;
                             strBuff.append("ND start : "+tempLine+"\n");                         
                        if(tempLine.contains("Inside NetworkDiscoveryDetails.jsp"))
                             strBuff.append("ND end : "+tempLine+"\n");
                             //System.out.println(" ND end : "+tempLine);
                        if(tempLine.contains("Given IPRange from"))
                             startPos = tempLine.indexOf("from");
                             catVersion = tempLine.substring(startPos+5,tempLine.length());
                             strBuff.append("NDRange : "+catVersion+"\n");     
                             //strBuff.append("NDRange : "+tempLine+"\n");                                             
                             //System.out.println("NDRange :"+catVersion);     
                             startPos=0;
                             fromIndex=tempLine.indexOf(":");
                             endPos= tempLine.indexOf(':', fromIndex+2);
                             //System.out.println("fromIndex : "+fromIndex+" endPos : "+endPos);
                             timeStr=tempLine.substring(startPos, endPos);
                             nameStr=catVersion.replaceAll(" ", "_");                         
                             strBuff2.append("ND_"+timeStr+" "+catVersion+" = "+"NDRange_"+nameStr+".log\n");
                        if(tempLine.contains("inside ByIpAddress.jsp"))
                             ddFlag=true;
                             strBuff.append("DD Start : "+tempLine+"\n");                                                  
                        if(tempLine.contains("start_IpAddress:"))
                             startPos = tempLine.indexOf("start_IpAddress:");
                             catVersion = tempLine.substring(startPos+16,tempLine.length());
                             startIP=catVersion;                         
                        if(tempLine.contains("end_IpAddress"))
                             startPos = tempLine.indexOf("end_IpAddress");
                             catVersion = tempLine.substring(startPos+13,tempLine.length());
                             endIP=catVersion;                         
                             if(endIP.length()==0)
                                  System.out.println("hi5");
                                  strBuff.append("DDSingleIP : "+startIP+"\n");
                                  //strBuff.append("DDSingleIP : "+tempLine+"\n");                              
                                  //System.out.println("DDSingleIP : "+startIP);
                                  //startPos = tempLine.indexOf(" ");
                                  startPos=0;
                                  fromIndex=tempLine.indexOf(":");
                                  endPos= tempLine.indexOf(':', fromIndex+2);
                                  timeStr=tempLine.substring(startPos, endPos);     
                                  strBuff2.append("DD_"+timeStr+" "+startIP+" = "+"DDSingleIP_"+startIP+".log\n");
                             else
                                  strBuff.append("DDRangeIP : "+startIP + " to "+ endIP+"\n");
                                  //strBuff.append("DDRangeIP : "+tempLine+"\n");                              
                                  //System.out.println("DDRangeIP : "+startIP + " to "+ endIP);
                                  //startPos = tempLine.indexOf(" ");
                                  startPos=0;
                                  fromIndex=tempLine.indexOf(":");
                                  endPos= tempLine.indexOf(':', fromIndex+2);
                                  timeStr=tempLine.substring(startPos, endPos);                         
                                  strBuff2.append("DD_"+timeStr+" "+startIP+" to "+endIP+" = "+"DDRangeIP_"+startIP +"_to_"+ endIP+".log\n");
                        if(tempLine.contains("set percentage completedCount: 100"))
                             System.out.println("hi...1");
                             strBuff.append("DD End : "+tempLine+"\n");
                             //System.out.println("DD End : "+tempLine);          
                   reportFileName=ResourceBundle.getBundle("catconfig").getString("reportFileName");
                   savereportFile(strBuff,reportFileName);
                   if(ndFlag)
                        strBuff1.append("Network Discovery\n");                    
                   if(ddFlag)
                        strBuff1.append("Device Discovery\n");
                   moduleFileName=ResourceBundle.getBundle("catconfig").getString("moduleFileName");
                   savereportFile(strBuff1,moduleFileName);
                   propFileName=ResourceBundle.getBundle("catconfig").getString("propFileName");
                   savereportFile(strBuff2,propFileName);
              } catch (Exception e)
                   System.out.println("error hi1");
                   System.out.println("Exception@findDetails : "+e);
        public void savereportFile(StringBuffer strBuff,String targetFileName)
              try{
                   String userdir = System.getProperty("user.dir");
                   String logFilePath=ResourceBundle.getBundle("catconfig").getString("logFilePath");
                   String reportFile=userdir+logFilePath+targetFileName;     
                   String fileContent="";
                   fileContent=strBuff.toString();
                      //System.out.println("file content : "+fileContent);
                      FileWriter fileWriter = new FileWriter(reportFile);
                      if(fileContent!=null)
                           fileWriter.write(fileContent);
                      fileWriter.close();
              catch(Exception e)
                   System.out.println("error hi1");
                   System.out.println("Exception@savereportFile : "+e);
        public ArrayList<String> getFileNames()
             String reportFile=ResourceBundle.getBundle("catconfig").getString("reportFileName");
             String logFilePath=ResourceBundle.getBundle("catconfig").getString("logFilePath");
             String userdir = System.getProperty("user.dir");
              RandomAccessFile repFile=null;
              String reportLine = null;
              int colon=0;
              int fromIndex=0;     
              int startPos=0;
              int endPos=0;
              String timeStr="";
              String fileName=null;          
              ArrayList<String> nameList=new ArrayList<String>();          
             try
                  reportFile=userdir+logFilePath+reportFile;
                  repFile = new RandomAccessFile(reportFile, "r");
                  while ((reportLine = repFile.readLine()) != null) {                    
                        if(reportLine.contains("NDRange"))
                             colon=reportLine.indexOf(" : ");
                             fileName=reportLine.substring(colon+3, reportLine.length());
                             fileName="NDRange_"+fileName.replaceAll(" ", "_");
                             nameList.add(fileName);
                             System.out.println("fileName : "+fileName);
                        if(reportLine.contains("DDSingleIP"))
                             colon=reportLine.indexOf(" : ");
                             fileName=reportLine.substring(colon+3, reportLine.length());
                             fileName="DDSingleIP_"+fileName.replaceAll(" ", "_");
                             nameList.add(fileName);
                             System.out.println("fileName : "+fileName);
                        if(reportLine.contains("DDRangeIP"))
                             colon=reportLine.indexOf(" : ");
                             fileName=reportLine.substring(colon+3, reportLine.length());
                             fileName="DDRangeIP_"+fileName.replaceAll(" ", "_");
                             nameList.add(fileName);
                             System.out.println("fileName : "+fileName);
                  repFile.close();
             catch(Exception e)
                   System.out.println("Error@getFileNames : "+e);
             return nameList;
        public void writeFile(String oldLogName,String newLogName)
             try
                   FileOutputStream writeFile=null;               
                   String line = null;
                   String userdir = System.getProperty("user.dir");
                   String reportFile=ResourceBundle.getBundle("catconfig").getString("reportFileName");     
                   String newLogPath=ResourceBundle.getBundle("catconfig").getString("logFilePath");
                   RandomAccessFile repFile=null;               
                   String reportLine = null;
                   String tempLine=null;
                   String prevLine=null;
                   String nextLine=null;
                   String target=null;
                   String tempStr=null;
                   String startStr=null;
                   String endStr=null;          
                   int pos=0;
                   boolean flag=false;
                   boolean writeFlag=false;
                   boolean versionFlag=false;               
                   //System.out.println("newLogName : "+newLogName);     
                   newLogPath=userdir+newLogPath;
                   System.out.println("newLogPath : "+newLogPath);     
                   BufferedReader buffRead = new BufferedReader(new FileReader(oldLogName));
                   writeFile = new FileOutputStream(newLogPath+newLogName+".log", false);//true-for append mode
                   DataOutputStream dout=new DataOutputStream(writeFile);               
                   tempStr=newLogName.replace("_", " ");
                   pos=tempStr.indexOf(" ");
                   startStr=tempStr.substring(0,pos);
                   endStr=tempStr.substring(pos+1, tempStr.length());
                   target=startStr+" : "+endStr;
                   System.out.println("target ===> "+target);               
                   reportFile=newLogPath+reportFile;
                   repFile = new RandomAccessFile(reportFile, "r");
                  while ((reportLine = repFile.readLine()) != null) {                   
                       if(reportLine.contains(target))
                            flag=true; 
                            prevLine=tempLine;
                            //System.out.println("prevLine *****: "+prevLine);
                       else
                            tempLine=reportLine;
                            if(flag==true)
                                 nextLine=reportLine;
                                 flag=false;
                                 //System.out.println("nextLine *******:"+nextLine);
                                 break;
                  repFile.close();     
                 if(prevLine!=null && prevLine.length()>0)
                       pos=prevLine.lastIndexOf(" : ");
                       prevLine=prevLine.substring(pos+3, prevLine.length());
                       //System.out.println("prevLine : "+prevLine);
                  else
                       System.out.println("Starting line not available for : "+target);
                  if(nextLine!=null && nextLine.length()>0)
                        pos=nextLine.lastIndexOf(" : ");
                        nextLine=nextLine.substring(pos+3, nextLine.length());
                        //System.out.println("nextLine : "+nextLine);
                  else
                       System.out.println("Ending line not available for : "+target);
                       nextLine=prevLine;
                   while ((line=buffRead.readLine()) != null) {     
                        if(line.contains("CAT version is :") && !versionFlag)
                             versionFlag=true;
                             dout.writeBytes(line+"\n");                         
                        if(line.contains(prevLine))
                             writeFlag=true;                         
                        if(line.contains(nextLine))
                             writeFlag=false;
                             break;
                        if(writeFlag)
                             dout.writeBytes(line+"\n");
                  dout.writeBytes(nextLine+"\n");
                   buffRead.close();     
                   System.out.println("done");
              catch(Exception e)
                   System.out.println("Exception@writeFile : "+e.getMessage());
        public String folderCheck(String foldName)
              File folder=null;
              File newFile=null;
              String[] folderContent=null;
              String tempFileName="";
              String newLogName="";
              int count=0;     
              String logFilePath="";     
              String fileName="";
              String feedBackMsg="";          
              String userdir = System.getProperty("user.dir");
              logFilePath=ResourceBundle.getBundle("catconfig").getString("logFilePath");
              fileName=ResourceBundle.getBundle("catconfig").getString("fileName");
              folder=new File(foldName);
              if(folder.isDirectory())
                   newLogName=userdir+logFilePath+fileName;
                   //System.out.println("newLogName : "+newLogName);
                   newFile=new File(newLogName);
                   if(newFile.exists())
                        newFile.delete();
                   folderContent= folder.list();
                   if (folderContent != null && folderContent.length>0)
                        System.out.println("folder has files : "+folderContent.length);                    
                        for(int iterate=0;iterate < folderContent.length;iterate++){                         
                             if (folderContent[iterate].toLowerCase().contains("system"))
                                  count++;                              
                                  tempFileName=foldName+"/"+folderContent[iterate];     
                                  try
                                       FileOutputStream appendedFile=null;
                                       BufferedReader buffRead = new BufferedReader(new FileReader(tempFileName));
                                       appendedFile = new FileOutputStream(newLogName, true);//true-for append mode
                                        DataOutputStream dout=new DataOutputStream(appendedFile);
                                        String line = null;
                                       System.out.println("writting : "+tempFileName);
                                       while ((line=buffRead.readLine()) != null) {                                        
                                            dout.writeBytes(line+"\n");
                                       buffRead.close();          
                                       //System.out.println("done");
                                  catch(Exception e)
                                       System.out.println("Exception@folderCheck : "+e);
                        if(count==0)
                             feedBackMsg="syslognotavail";
                             //System.out.println("System Log(s) not available");
                        else
                             feedBackMsg="syslogavail";
                             //System.out.println(count +" System log(s) avail");
                   else
                        feedBackMsg="filesnotavail";
                        //System.out.println("Files are not in the folder");
              else
                   feedBackMsg="Dirnotavil";
                   //System.out.println("Directory not exists in the given name");
              return feedBackMsg;
        public ArrayList<String> loadFileContent(String selectedStr)
             //System.out.println("inside loadFileContent()");
             String logFilePath="";
             String propFileName="";
             String line="";
             String choice="";
             String tempStr="";
             int startPos=0;
             int endPos=0;
             ArrayList<String> timeList=new ArrayList<String>();
             String userdir = System.getProperty("user.dir");
             try
                  logFilePath=ResourceBundle.getBundle("catconfig").getString("logFilePath");
                  propFileName=ResourceBundle.getBundle("catconfig").getString("propFileName");
                  propFileName=userdir+logFilePath+propFileName;
                  BufferedReader buffRead = new BufferedReader(new FileReader(propFileName));
                  if(selectedStr.equalsIgnoreCase("Device Discovery"))
                       choice="DD";
                  else if(selectedStr.equalsIgnoreCase("Network Discovery"))
                       choice="ND";
                  while ((line=buffRead.readLine()) != null) {                                        
                        if(line.contains(choice))
                             System.out.println(line);
                             startPos=line.indexOf("_");
                             endPos=line.indexOf(" =");
                             tempStr=line.substring(startPos+1, endPos);
                             System.out.println("tempStr : "+tempStr);
                             timeList.add(tempStr);
                   buffRead.close();          
             catch(Exception e)
                  System.out.println("Exception@loadFileContent : "+e);
             return timeList;
        public String getFileName(String timeStr)
             System.out.println("inside getFileName");
             String logFilePath="";
             String propFileName="";
             String line="";
             String tempStr="";
             int startPos=0;
             String userdir = System.getProperty("user.dir");
             try
                  logFilePath=ResourceBundle.getBundle("catconfig").getString("logFilePath");
                  propFileName=ResourceBundle.getBundle("catconfig").getString("propFileName");
                  propFileName=userdir+logFilePath+propFileName;              
                  BufferedReader buffRead = new BufferedReader(new FileReader(propFileName));              
                  while ((line=buffRead.readLine()) != null) {                                        
                        if(line.contains(timeStr))
                             System.out.println(line);
                             startPos=line.indexOf(" = ");                         
                             tempStr=line.substring(startPos+3, line.length());
                             System.out.println("tempStr : "+tempStr);                         
                   buffRead.close();          
             catch(Exception e)
                  System.out.println("Exception@loadFileContent : "+e);
             return tempStr;
        public ArrayList loadFile()
             String logFilePath="";
             String moduleFileName="";
             String line="";         
             ArrayList<String> moduleList=new ArrayList<String>();
             String userdir = System.getProperty("user.dir");
             try
                  logFilePath=ResourceBundle.getBundle("catconfig").getString("logFilePath");
                  moduleFileName=ResourceBundle.getBundle("catconfig").getString("moduleFileName");
                  moduleFileName=userdir+logFilePath+moduleFileName;
                  BufferedReader buffRead = new BufferedReader(new FileReader(moduleFileName));              
                  while ((line=buffRead.readLine()) != null) {     
                       moduleList.add(line);                    
                   buffRead.close();          
             catch(Exception e)
                  System.out.println("Exception@loadFile : "+e);
             return moduleList;
    public static void main(String[] args) {          
         System.out.println("Inside main");     
         //String userdir = System.getProperty("user.dir");
         //System.out.println("userdir : "+userdir);
         /*ArrayList<String> fileNameList=new ArrayList<String>();
         String Choice="";     
         String logFileName="";     
         String logFilePath="";     
         String totalLog="";     
         String newLog="";     
         String folderName="";
         Choice=ResourceBundle.getBundle("catconfig").getString("Choice");
         logFileName=ResourceBundle.getBundle("catconfig").getString("logFileName");     
         logFilePath=ResourceBundle.getBundle("catconfig").getString("logFilePath");
         folderName=ResourceBundle.getBundle("catconfig").getString("folderName");
         totalLog=ResourceBundle.getBundle("catconfig").getString("fileName");     */
         /*try
              //to write the total log
              //folderCheck(folderName);
              //to find the details in the given log
              //findDetails();
              //to split the logs accordingly
              totalLog=logFilePath+totalLog;          
              fileNameList=getFileNames();;
              System.out.println("FileNameList size = "+fileNameList.size());
              for(int i=0;i<fileNameList.size();i++)
                   newLog=fileNameList.get(i).toString();
                   writeFile(totalLog,newLog);
              //to analyse the logs & to produce reports          
              //getValuesFromFilesOnly(Choice,logFileName);          
         }catch (Exception e)
              System.out.println(e.getMessage());
    }[                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    JSP is used for server validation.
    So you need a an application server (like Tomcat or Jboss) to execute your jsp files.
    you can create the .war file of your simple jsp application and put it in the server.
    then you will have to access your page using a web browser.
    the URL will be
    http://<ComputerName or IP Address>:<PortNumber>/<WarFileName>/<MainJspPage>
    (eg: http://100.100.100.252:8080/SimpleApplication/mainPage.jsp)
    -Achyuth

  • Problem building EJB jar file using Eclipse

    Hi,
    Here's my file sturcture.
    ejb\x\y\z\test\
    ejb\x\y\z\test1\
    'ejb' is the root directory.
    The java source files under 'test' have a package name x.y.z.test.
    The java source files under 'test1' have a package name x.y.z.test1.
    I want to build a EJB jar file for 'test' and 'test1' separately. In eclipse when I create an EJB project, I specify the root folder as the source in the java build path settings. So the project explorer in Eclipse shows both the packages since they are under the same root folder. When I try to do 'Export - EJB Jar File', it includes both the 'test' and 'test1' in the .jar. Is there a way to build them separately ?
    Thanks,

    As far as I know, there is no way in Eclipse to specify a package prefix for a source folder. Assuming that you are not using an operating system with support for symbolic links at FS-level, the only way I can think of solving your problem is via linked folders and includes/excludes.
    1. Create two ejb projects in your workspace. Specify locations somewhere independent of where the root of your source tree is located.
    2. Right click on proj1 and select Properties / Java Build Path / Source.
    3. Click Link Source and specify the location to your source root on disk. Click Next.
    4. In the inclusion patterns section, add a pattern that captures classes appropriate for that module. Click Finish.
    5. Delete the original source directory that was created during project creation before leaving Build Path configuration dialog.
    6. Repeat steps 2-5 on the second project, except specify a different inclusion pattern.
    This should produce a project structure that Eclipse will be happy with, but you have to be a little bit careful. Even though you filtered out classes from the view of the java compiler for a particular project, you will still see them listed in the various navigational views (such as Package Explorer or Project Explorer). Don't modify these filtered out files. The project that is supposed to be building them will not react to changes in the other project. You will have to manually refresh (right click on project and select refresh) the other project before the java compiler will see changes.
    Hope this will help you out.
    - Konstantin

  • An installer created with LV2011SP1 won't install on a machine with LV2013 installed

    I'm currently working on several FPGA drivers generated with Labview 2011SP1, which include a dll interface and a test program to test functionality of the dll. I used an installation pacakge to install 1) the dll to system32
                                                                   2) the .dll/.lib/.h to an absolute path on the target PC.
                                                                   3) the .exe test program to an absolute path on the target PC.
                                                                   4) the necessary NI components (The NI Labview Run-Time Engine 2011 SP1 f5 and NI R series RIO 13.1),
                                                                       via the additional installers section of the Installer dialog.
    This has been working fine, up until the customer installed Labview 2013 on his system. When I then gave him the next release of the package, it fails to install, with the message <files> "Incompatible with products already installed". Via trial and error I removed various of the 4 items listed above and the problem only disappears when 4), the NI components are removed. I then uninstalled LV2013, and retried my installation and it works. The customer doesn't need LV2013 on the machine so this fix is ok for now, but I am now concerned that all these similar packages I'm producing, delivered to several different customers, could be prevented from working if a target PC contains a later version of Labview than the one it was developed on.
    Can someone confirm this issue and how it can be rectified?
    I've found the following http://digital.ni.com/public.nsf/allkb/F41A941BE2AFAC47862574B100736584 issue which is possibly the same issue, but with a much older version of LV (I'd have expected it to have been fixed by LV2011SP1!). The fix for the above issue is to uninstall the runtime engines, however they don't appear on the list of installed NI products, and to unsintall them I apparently need to use an unsupported tool called msiblaster? Even if this worked, if the customer wanted to use LV2013 in the future, how could I support that?
    I'm getting increasingly frustrated that I spend more of my time trawling the forums finding fixes for LV bugs than trawling my own code fixing my own bugs... 

    redfrank wrote:
    I'm getting increasingly frustrated that I spend more of my time trawling the forums finding fixes for LV bugs than trawling my own code fixing my own bugs... 
    There's an easy solution to that problem.
    Write more buggy code.....
    This joke was brought to you by increasing levels of frustration during a day of non-reproducible  Real-Time benchmarking.....
    Say hello to my little friend.
    RFC 2323 FHE-Compliant

  • How to run an application i created in java without using eclipse

    Im familiar with running an application i create thru command prompt or eclipse, how do i create a file to run on any computer with java so i can double click the file and my application runs. C# automatically does this, do i need to do an extra step to the jar file?

    Hi,
    You need to make an executable JAR file. There are a few ways you can do this but since you are using Eclipse you can follow this tutorial.
    [http://www.fsl.cs.sunysb.edu/~dquigley/cse219/index.php?it=eclipse&tt=jar&pf=y]
    The most important part is the manifest file, if you have dependencies on other JAR files they will need to be specified along with the
    main method to call to start you program. You can do this via the Eclipse Wizard.
    It will be in your interests to read this tutorial also
    [http://java.sun.com/docs/books/tutorial/deployment/jar/]

  • Problem in viewing a converted JavaHelp (jar) file (created using RH2002 to RoboHelp X5)

    Hi,
    I have a javahelp project (compressed javahelp) created using
    RoboHelp 2002. The output files are jar files.
    The source files are .mpj. When I view the existing jar files
    without converting the project to .xpj I am able to view the jar
    files.
    However, this project needs to be upgraded to RHx5. During
    conversion(.mpj to .xpj) everything seems to be working fine and
    the javahelp files are generated. But when I try to view the jar
    files nothing is diplayed.
    I get the following error. Please see below.
    Has anybody come across anything similar? Is there anything I
    need to take care of before I upgrade to .xpj? I cannot locate the
    glo.xml file in RH.
    Best regards,
    Urmi
    Parsing failed for null
    Exception caught while parsing jar:file:C:/Documents and
    Settings/urmiroy/Desktop/ep2_cd1helps/Developer_edit/JavaHelp/FLEXIEDGEBTS_dev_edit.jar!/ FLEXIEDGEBTS_dev_edit_glo.xmljava.io.FileNotFoundException:
    JAR entry FLEXIEDGEBTS_dev_edit_glo.xml not found in C:\Documents
    and
    Settings\urmiroy\Desktop\ep2_cd1helps\Developer_edit\JavaHelp\FLEXIEDGEBTS_dev_edit.jar
    Exception occurred during event dispatching:
    java.lang.NullPointerException
    at
    javax.help.MergeHelpUtilities.mergeNodeChildren(MergeHelpUtilities.ja
    va:89)
    at
    javax.help.plaf.basic.BasicGlossaryNavigatorUI.loadData(BasicGlossary
    NavigatorUI.java:217)
    at
    javax.help.plaf.basic.BasicGlossaryNavigatorUI.reloadData(BasicGlossa
    ryNavigatorUI.java:198)
    at
    javax.help.plaf.basic.BasicGlossaryNavigatorUI.installUI(BasicGlossar
    yNavigatorUI.java:146)
    at javax.swing.JComponent.setUI(Unknown Source)
    at javax.help.JHelpNavigator.setUI(JHelpNavigator.java:257)
    at
    javax.help.JHelpNavigator.updateUI(JHelpNavigator.java:276)
    at
    javax.help.JHelpNavigator.<init>(JHelpNavigator.java:105)
    at
    javax.help.JHelpGlossaryNavigator.<init>(JHelpGlossaryNavigator.java:
    62)
    at
    javax.help.GlossaryView.createNavigator(GlossaryView.java:82)
    at javax.help.JHelp.setupNavigators(JHelp.java:148)
    at javax.help.JHelp.<init>(JHelp.java:126)
    at javax.help.JHelp.<init>(JHelp.java:76)
    at
    sunw.demo.jhdemo.JHLauncher$DisplayAction.actionPerformed(JHLauncher.
    java:956)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown
    Source)
    at
    javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknow
    n Source)
    at
    javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at
    javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown
    Sour
    ce)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown
    Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown
    Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown
    Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at
    java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
    Source)
    at
    java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at
    java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.Dialog$1.run(Unknown Source)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at
    java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
    Source)
    at
    java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

    Hi Colum,
    Thanks for your reply.
    Yes, I have gone through the Peter Grainge's article. It is
    indeed very informative and I have installed the JDK and the JH
    according to the instructions given therein. My installation seems
    complete as the viewer works fine. The JDK version is 1.4.2_18 and
    the JH version is 2.0. The environment variables have also been set
    accordingly.
    All this while I was thinking it is a Java issue so I have
    tried out with different JDK versions.
    But now I think it can be a tool issue because :
    I can view the existing JavaHelp file with the current Java
    viewer.(if I do not open the project in X5)
    I can view Sun supplied sample jar files with the viewer.
    I can create new JavaHelp files with RHX5 and the current JDK
    and JH installation and view those files.
    I cannot view the JavaHelp file if I convert the .mpj to .xpj
    (the generate dialog works fine and says compilation is complete).
    The Display button does not display the file. The view
    command line command throws up the error mentioned in my earlier
    mail.
    Would appreciate any pointers.
    Best regards,
    Urmi

  • Creating & Using .jar files and manifests

    I've read through hundreds of online tutorials on creating and using .jar's, but it's surprising how unhelpful they really are.
    I've been trying to make a java program of mine standalone, so I can distribute it to others and allow them to run it without use of a compiler, etc (ideally just a .exe or .bat that they double click on). Everything I've found says I need to create a .jar of my program in order to do this. I was finally able to create a .jar but I got different errors relating to "main-class" and "manifest" issues...I tried running it with javaw.exe and had the same problem.
    Some tutorials briefly discuss "meta manifest's", other's skip the concept all together in creating .jar's. I created a jar with:
    jar cf A2.jar c:\jarTester.java
    after changing my command prompt path to
    C:\Program Files\Java\jdk1.6.0_01\bin
    It created the .jar, but nothing worked. As above, it gave me errors relating to the "Main-Class" and "Manifest". So here's my question:
    What involvement does a "manifest" play in .jar's, and how do I create/use one to create a .jar? Why is it necessary to specify the "Main-Class" when I have already done so in my .java file?
    I believe that once I can get this "Main-Class" and "Manifest" problem straightened out, I will be able to create a batch file with the line:
    java -jar A2.jar
    is this correct? THANKS.

    I've read through hundreds of online tutorials on
    creating and using .jar's, but it's surprising how
    unhelpful they really are.really, hundreds?
    I've been trying to make a java program of mine
    standalone, so I can distribute it to others and
    allow them to run it without use of a compiler, etc
    (ideally just a .exe or .bat that they double click
    on). Everything I've found says I need to create a
    .jar of my program in order to do this. Make up your mind, do you want to make a jar or an exe?
    I was
    finally able to create a .jar but I got different
    errors relating to "main-class" and "manifest"
    issues...I tried running it with javaw.exe and had
    the same problem.
    Some tutorials briefly discuss "meta manifest's",
    other's skip the concept all togetherthat's because the manifest isn't usually necessary
    in creating
    .jar's. I created a jar with:
    jar cf A2.jar c:\jarTester.javaugh, that won't work. you need to put the class file in there, not the source. or you can put the source in as well if you want, but the class is necessary
    i'm ignoring the rest of this post for now
    go back to Google and type in jar manifest and read more

  • How to create an EJB Module using Eclipse

    Hi,
    How do I create a single EJB module and make a deployable EJB jar? I already have a existing source directory that contains the java files and the deployment descriptor. I am using Eclipse Ganymede 3.4 and Weblogic 9.2.
    Thanks.
    Edited by: user10387019 on Dec 9, 2008 1:39 PM

    Start out by creating an empty EJB project using the EJB Project wizard. Make sure to specify your WebLogic 9.2 installation as target runtime on the first page of the wizard. If your EJB source code is plain spec-compliant EJB, then your project is ready. If you are using WLS EjbGen technology, then you will also need to enable that feature on the project. You can do that at project creation by clicking the Modify button next to the Configuration combo on the first page of the wizard and then selecting WebLogic EJB Gen Support facet.
    Once the project is created, you are ready to import your source. You have several choices here. You can either copy your source into the src directory created for you or you can delete that source directory and link to a source directory elsewhere on the file system. To do the latter, right click on the project and select properties. Go to Java Build Path and select the Source tab. Remove the existing source directory. Then click on Link Source button and point to your existing source directory.
    That should be all that's necessary. Hope that helps.
    - Konstantin

  • Java JDK 7 u17 won't install and Eclipse won't run past boot logo.

    Java JDK 7 u17 won't install and Eclipse won't run past boot logo. Eclipse Classic used to work fine for awhile. I haven't used it for a month or two and tried to boot it, Eclipse won't run past boot logo. It looks like JDK is not even there anymore. JDK won't install successfully. I have Mac OS X 10.8.3.
    I tried removing Java, re-download JDK multiple times.. same results.
    MyComputer-MacBook-Air:~ MyComputer$ java -version
    java version "1.7.0_17"
    Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
    Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)

    Paul Adare is correct in saying that you cannot "upgrade" from 32-bit to 64-bit. You can, however, backup your files and reload them onto your PC.
    Given that you are able to boot Windows 7 after the failure to install Windows 10 Technical Preview, it is apparent that you are not formatting the drive during your clean installation. There are a number of potential issues an existing configuration can
    cause, such as preventing Windows Setup from registering boot files, modifying partitions, or moving an existing installation and data to the windows.old folder. I would recommend removing the partitions from your drive (note: this will erase any data remaining
    on the hard disk) during installation to ensure that Windows Setup has a fresh hard drive to install to. If you continue to experience errors, two other factors to take into consideration are:
    Does your system use a storage controller that requires loading a driver during Windows Setup?
    Is the hardware malfunctioning? Do the hard disk and memory pass testing software like Windows Memory Diagnostic or chkdsk?
    Reference
    this article for more information.
    Hessam
    Windows Outreach Team- IT Pro
    Windows for IT Pros on TechNet

  • Really impossible to create a web service for JBoss using eclipse's WTP?

    I'm starting to get nuts!!!
    I'm an experienced J2SE and J2ME Java developer... but I have huge problems creating a web service using eclipse WTP!
    The tutorials I found are for tomcat... But I want to code for JBoss and not for tomcat...!!!
    There must be somebody out there with the same issues...
    This tutorial works fine for Tomcat...
    http://www.eclipse.org/webtools/community/tutorials/BottomUpWebService/BottomUpWebService.html
    But if I do the same with JBoss... it's not possible to incoke my web service method... ok, I thought... just need to check google... BUT I didn't find any solution in the whole WWW. Found a lot of questions of people with the same problems... but no solution! :(
    Still getting that:
    ERROR [EngineConfigurationFactoryServlet] Unable to find config file. Creating new servlet engine config file: /WEB-INF/server-config.wsdd
    I know a little bit what a wsdd does... but isn't it the job of the WTP to create that file???
    I really hope you have some places for me to start, 'cause I don't know anymore places to ask for...
    Maybe this is a JBoss issue... I don't know...
    Or is there a tutorial on how to create a web Service using JBoss IDE?
    Sascha

    Hi Massimo,
    Quiet a few points here.
    1. Oracle Type objects do not map to XML Complex type
    2. Oracle Type objects do not map to Apex Page Item Types
    3. Apex Page Item types are substituted into the WS Request XML by a process which is part of the Web Service Reference creation through the Wizard in Apex.
    >
    After created the web service (without any errors), I click on test.
    - I can select the Operation --> CREATE_LINGUA
    - I can input data for Basic Authentication
    - I can't view Input Parameters --> Report returned no rows.
    I've tried with normal type like Varchar2 and all was ok.
    Is possible in Apex to use web services based on complex type, tipically an Array?
    >
    As you have guessed the Wizard driven Web Service Reference definition process cannot handle complex types of input parameters required by a Request. By definition the number of complex types possible are infinite, so they are not likely to come built in.
    Passing an array is no solution because finally the values passed have to be plugged into the right SimpleTypes inside a ComplexType in the Request.
    Based on your WSDL your Request will be
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cre="http://xmlns.oracle.com/orawsv/GRIMALDI/PKG_WEBSERVICES/CREATE_LINGUA">
       <soapenv:Header/>
       <soapenv:Body>
          <cre:SNUMBER-CREATE_LINGUAInput>
             <cre:PLINGUA-LINGUAT-CIN>
                <cre:LINGUAT>
                   <cre:CODICE>?</cre:CODICE>
                   <cre:DESCRIZIONE>?</cre:DESCRIZIONE>
                </cre:LINGUAT>
             </cre:PLINGUA-LINGUAT-CIN>
          </cre:SNUMBER-CREATE_LINGUAInput>
       </soapenv:Body>
    </soapenv:Envelope>However, all is not lost. You can always use the UTL_HTTP package API to construct your Request.
    Regards,

  • Problem Exporting .Jar Using Eclipse

    I have a small problem of exporting using Eclipse 3.2
    First , i could , debug , run as application with no problem.
    however after i compiled into jar , and i tried opening the jar file
    theres no responses. what could possibly be the problem ?
    my manifest file includes the main class of program and all external .jar files.
    below is my main class
    -automatic batch printing
    -able to select target folder for batch printing
    -able to select interval for printing
    -able to stop printing
    -includes log of activity of threads and printing services
    -free for all to use =D
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Desktop;
    import java.awt.Graphics;
    import javax.swing.JFileChooser;
    import javax.swing.JPanel;
    import javax.swing.JFrame;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.print.*;
    import java.io.*;
    import java.util.*;
    import java.util.Timer;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.swing.*;
    import javax.swing.filechooser.*;
    import javax.swing.filechooser.FileFilter;
    import javax.print.*;
    import java.lang.Object;
    import java.awt.JobAttributes.*;
    import javax.swing.text.*;
    import javax.swing.text.html.HTMLDocument;
    import javax.swing.text.rtf.*;
    import java.awt.Dimension;
    import javax.swing.JEditorPane;
    import java.awt.Rectangle;
    import javax.swing.JOptionPane;
    import javax.swing.JScrollPane;
    import javax.swing.JButton;
    import javax.swing.JTextPane;
    import javax.swing.JTextArea;
    import javax.swing.JTextField;
    import javax.swing.JCheckBox;
    import javax.swing.JLabel;
    import javax.swing.SwingUtilities;
    import java.awt.Font;
    public class Test extends JFrame implements Printable{
         private static final long serialVersionUID = 1L;
         private JPanel jContentPane = null;  //  @jve:decl-index=0:visual-constraint="36,9"
         private JButton Open = null;
          Date date;
           class MyFilter extends javax.swing.filechooser.FileFilter {
                 public boolean accept(File file) {
                     String filename = file.getName();
                             if(file.isDirectory()){
                          return true;
                     }else{
                          return filename.endsWith(".rtf");
                 public String getDescription() {
                     return "Rich Text Format ( .rtf ) ";
         public Test() {
              super();
              initialize();
         public static void main(String[] args) {
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        Test application = new Test();
                        application.show();
                        application.setLocationRelativeTo(null);
                        application.setVisible(true);
                        application.getJContentPane().setVisible(true);
         private void initialize() {     
              this.setSize(408, 282);
              this.setResizable(false);
              this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              this.setContentPane(getJContentPane());
              this.setTitle("Auto Print Utility");
              this.setVisible(true);
          * This method initializes jContentPane
          * @return javax.swing.JPanel
         private JPanel getJContentPane() {
              if (jContentPane == null) {
                   jLabel1 = new JLabel();
                   jLabel1.setBounds(new Rectangle(131, 102, 59, 16));
                   jLabel1.setFont(new Font("Apple Chancery", Font.PLAIN, 10));
                   jLabel1.setText("MilliSeconds");
                   jLabel = new JLabel();
                   jLabel.setBounds(new Rectangle(16, 103, 53, 16));
                   jLabel.setText("Interval :");
                   jContentPane = new JPanel();
                   jContentPane.setLayout(null);
                   jContentPane.add(getOpen(), null);
                   jContentPane.add(getStop(), null);
                   jContentPane.add(getJTextField(), null);
                   jContentPane.add(getJScrollPane(), null);
                   jContentPane.add(getJScrollPane1(), null);
                   jContentPane.add(getJTextField1(), null);
                   jContentPane.add(jLabel, null);
                   jContentPane.add(jLabel1, null);
                   jContentPane.add(getJButton(), null);
              return jContentPane;
         static void printPrinterJob() {               
                    PrinterJob printerjob = PrinterJob.getPrinterJob();
                    // set the characteristics of
                    // the job to be printed - use setPageable and book if
                    // outputing a document. Use setPrintable for "simple" printing - all pages formatted the same
                    printerjob.setPrintable(new Test());
                    try {
                      PrintService[] ser =PrinterJob.lookupPrintServices();
                         ReadRegistry rr = new ReadRegistry();
                     int x =ser.length;
                      //  String def = rr.getPrinter();
                     String def ="Microsoft Office Document Image Writer";
                     for(int y=0;y<x;y++){
                         if(ser[y].getName().equals(def)){
                             printerjob.setPrintService(ser[y]);
                             System.out.println(ser[y]+" SET");
                         }else
                     System.out.println(ser[y]);
                    } catch (PrinterException exception) {
                       System.err.println("Printing error: " + exception);
       public static void disableDoubleBuffering(Component c) {
                  RepaintManager currentManager = RepaintManager.currentManager(c);
                  currentManager.setDoubleBufferingEnabled(false);
      public static void enableDoubleBuffering(Component c) {
                  RepaintManager currentManager = RepaintManager.currentManager(c);
                  currentManager.setDoubleBufferingEnabled(true);
      public boolean printfolder(){
              Desktop de = Desktop.getDesktop();
              java.io.File folder = new File(jTextField.getText());
              File[] listOfFiles = folder.listFiles();
               for (int i = 0; i < listOfFiles.length; i++) {
                    if (listOfFiles.isFile()) {
                        try {
                                  de.print(listOfFiles[i].getAbsoluteFile());
                                  File fi = new File(jTextField.getText()+"\\Deleted");
                                  fi.mkdir();
                                  Thread.currentThread().sleep(1000);
                                  listOfFiles[i].renameTo(new File("Z:\\BTSS Log\\Fax\\Y2007 M10 D25\\Deleted",listOfFiles[i].getName().toString()));
                             } catch (Exception e1) {
                                  // TODO Auto-generated catch block
                                  e1.printStackTrace();
              System.out.println("File: " + listOfFiles[i].getName());
              date = new Date();
              PrintLog.append("Printed : "+listOfFiles[i].getName()+" "+date.toString()+"\n");
              } else if (listOfFiles[i].isDirectory()) {
                   date=new Date();
              System.out.println("Directory: " + listOfFiles[i].getName()+" "+date.toString());
              PrintLog.append("No Files Printed "+date.toString()+"\n");
              return true;
         private JButton Stop = null;
         Thread tt = new Thread(){
              public void run(){
                   while(true){
                   int count = 0; // @jve:decl-index=0:
                   printfolder();
                   try {
                        Long lon = new Long(jTextField1.getText());
                        System.out.println(lon);
              tt.sleep(lon);
              } catch (InterruptedException e) {}
              count++;
              if (count >= 10000) break;
         private JTextField jTextField = null;
         private JScrollPane jScrollPane = null;
         private JScrollPane jScrollPane1 = null;
         private JTextField jTextField1 = null;
         private JLabel jLabel = null;
         private JLabel jLabel1 = null;
         private JTextArea PrintLog = null;
         private JTextArea ThreadLog = null;
         private JButton jButton = null;
         public void run(){
                   while(true){
                   int count = 0;
                   printfolder();
                   try {
              // Thread.sleep (300000);//
                        Long lon = new Long(jTextField1.getText());
                        System.out.println(lon);
              Thread.currentThread().sleep(lon);
              } catch (InterruptedException e) {}
              count++;
              if (count >= 10000) break;
         private JButton getOpen() {
              if (Open == null) {
                   Open = new JButton();
                   Open.setBounds(new Rectangle(11, 38, 187, 29));
                   Open.setText("Start");
                   Open.addActionListener(new java.awt.event.ActionListener() {
                        public void actionPerformed(java.awt.event.ActionEvent e) {
                             try{
                                  if(jTextField1.getText().equals("")){
                                       JOptionPane.showMessageDialog(null,"MilliSeconds Required, Please Enter A Valid Number Into The TextBox", "MilliSeconds Required", JOptionPane.ERROR_MESSAGE);
                                  }else if(jTextField.getText().equals("")){
                                       JOptionPane.showMessageDialog(null,"Please Specify Directory To Be Print From By Clicking On The TextBox", "Directory Missing", JOptionPane.ERROR_MESSAGE);
                                  }else{
                                       Long.parseLong(jTextField1.getText());
                                       try {     
                                                 if(tt.isAlive()) {
                                                           tt.resume();
                                                           date=new Date();
                                                           ThreadLog.append("Activity Resumes "+date.toString()+"\n");
                                                 } else {
                                                                tt.start();                    
                                                                date=new Date();
                                                                ThreadLog.append("Activity Started "+date.toString()+"\n");
                                                      } catch (Exception f) {
                                                           JOptionPane.showMessageDialog(null, f.getMessage(), "Error Occured", JOptionPane.ERROR_MESSAGE);
                             }catch(Exception f){
                                  JOptionPane.showMessageDialog(null, f.getMessage(), "Long Format Exception", JOptionPane.ERROR_MESSAGE);
              return Open;
         * This method initializes Stop     
         * @return javax.swing.JButton     
         private JButton getStop() {
              if (Stop == null) {
                   Stop = new JButton();
                   Stop.setBounds(new Rectangle(197, 38, 195, 29));
                   Stop.setText("Stop");
                   Stop.addActionListener(new java.awt.event.ActionListener() {
                        public void actionPerformed(java.awt.event.ActionEvent e) {
              try{
         tt.suspend();
         date = new Date();
         ThreadLog.append("Activity Suspend "+date.toString()+" \n");
              }catch(Exception g){
                   JOptionPane.showMessageDialog(null, g.getMessage(), "Error Occured", JOptionPane.ERROR_MESSAGE);
              return Stop;
         public int print(Graphics arg0, PageFormat arg1, int arg2) throws PrinterException {
              // TODO Auto-generated method stub
              return 0;
         * This method initializes jTextField     
         * @return javax.swing.JTextField     
         */JFileChooser jfc = new JFileChooser();
         private JTextField getJTextField() {
              if (jTextField == null) {
                   jTextField = new JTextField();
                   ReadRegistry rr = new ReadRegistry();
                   String dpath = rr.getDirecotry();
                   File file = new File(dpath);
                   jfc.setCurrentDirectory(file);
                   jTextField.setText(dpath);
                   jTextField.setBounds(new Rectangle(11, 14, 383, 20));
                   jTextField.setEditable(false);
                   jTextField.addMouseListener(new java.awt.event.MouseAdapter() {
                        public void mouseClicked(java.awt.event.MouseEvent e) {
                             jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
                             jfc.showOpenDialog(jContentPane);
                             File file = jfc.getSelectedFile();
                             String path = file.getAbsolutePath();
                             jTextField.setText(path);
              return jTextField;
         * This method initializes jScrollPane     
         * @return javax.swing.JScrollPane     
         private JScrollPane getJScrollPane() {
              if (jScrollPane == null) {
                   jScrollPane = new JScrollPane();
                   jScrollPane.setBounds(new Rectangle(197, 70, 193, 55));
                   jScrollPane.setViewportView(getThreadLog());
              return jScrollPane;
         * This method initializes jScrollPane1     
         * @return javax.swing.JScrollPane     
         private JScrollPane getJScrollPane1() {
              if (jScrollPane1 == null) {
                   jScrollPane1 = new JScrollPane();
                   jScrollPane1.setBounds(new Rectangle(14, 132, 375, 108));
                   jScrollPane1.setViewportView(getPrintLog());
              return jScrollPane1;
         * This method initializes jTextField1     
         * @return javax.swing.JTextField     
         private JTextField getJTextField1() {
              if (jTextField1 == null) {
                   jTextField1 = new JTextField();
                   jTextField1.setBounds(new Rectangle(70, 101, 62, 20));
              return jTextField1;
         * This method initializes PrintLog     
         * @return javax.swing.JTextArea     
         private JTextArea getPrintLog() {
              if (PrintLog == null) {
                   PrintLog = new JTextArea();
                   PrintLog.setEditable(false);
                   PrintLog.setFont(new Font("Arial", Font.PLAIN, 12));
              return PrintLog;
         * This method initializes ThreadLog     
         * @return javax.swing.JTextArea     
         private JTextArea getThreadLog() {
              if (ThreadLog == null) {
                   ThreadLog = new JTextArea();
                   ThreadLog.setEditable(false);
                   ThreadLog.setFont(new Font("Taffy", Font.PLAIN, 10));
              return ThreadLog;
         * This method initializes jButton     
         * @return javax.swing.JButton     
         private JButton getJButton() {
              if (jButton == null) {
                   jButton = new JButton();
                   jButton.setBounds(new Rectangle(12, 70, 185, 25));
                   jButton.setText("Reset");
                   jButton.addActionListener(new java.awt.event.ActionListener() {
                        public void actionPerformed(java.awt.event.ActionEvent e) {
                             Test nt = new Test();
                             nt.show();
                             hide();
              return jButton;
    } // @jve:decl-index=0:visual-constraint="-9,-14"
    i can compile into jar successfully but the jar file wouldn't respond.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  

    first , it says unable to access jar file .
    upon deeper inspection i found that background processes is created behind thus the jar file been activated but the UI doesnt show up? any more idea of where my codes gone wrong? which seems perfect for me
    anyway thanks but i still .. it says unable to access jar file

  • Unable to install Adobe CS5 64 bit package created using Adobe Application Manager on Windows 7 64

    I am unable to install Adobe CS5 64 bit package created using Adobe Application Manager on Windows 7 64 bit.Basically installation rollback on Win 7 64 bit image.
    MSI Log File :-
    Property(S): ProductToBeRegistered = 1
    MSI (s) (5C:D4) [17:59:21:784]: Note: 1: 1708
    MSI (s) (5C:D4) [17:59:21:784]: Product: Adobe_CreativieSuite_5_MNT -- Installation operation failed.
    MSI (s) (5C:D4) [17:59:21:784]: Windows Installer installed the product. Product Name: Adobe_CreativieSuite_5_MNT. Product Version: 1.2.0000. Product Language: 1033. Manufacturer: Adobe Systems Incorporated. Installation success or error status: 1603.
    Please let me how to install 64 bit package on Win7 64 bit.
    Thanks in Advance.

    Ok so I downloaded the most current installer CS5.1, My previous installer was version 5.0. It did install fine fully updated to my license version. I just wanted to update in case anyone in the future has a similiar experience. Too bad this advice was not offered by the "experts" here.

Maybe you are looking for

  • Suddenly only randomly only receiving mails from certain people.....help !

    hi there i've sat on the phone with three people who have been resending emails to me from their office servers, and also gmail, and hotmail and haven't received any of them. I have received a couple of random mails from other people, but i would nor

  • Run java program in task bar and create a shortcut

    Hi all, Do you have any idea about how to run a Java task in taskbar on windows. I am writing a application in Java and it needs to monitor mouse movements. I need to collect the file paths it selects and then drag and drop on Shortcut Icon on Deskto

  • How to assign task to others with an attachment?

    Hi All, How to assign task to other with an attachment and field values in the actual InfoPath form? In detail, If a InfoPath form has submitted then task should be assigned to a person with an attachment and some field values which are present in In

  • When will javax.mail.SendFailedException throw?

    hi, i am a beginner of java and javamail I need to know when SendFailedException will throw (under what conditions). Is there any documentation I can read? thank you very much

  • JSP , Microsoft Access & Date/Time

    I am trying to write a program in which a database contains two tables pcorr & mscorr. result1 = stmt1.executeQuery("select pcorr.corrppo,mscorr.ppoprint from pensionr where pcorr.regimental = '" + icstr + " 'and (pcorr.status = 'P') and (mscorr.ppop