Java program for Sudoku puzzle

I basically need to list the possible solutions to every blank space in a sudoku puzzle. I can make my puzzle in a .txt file and then just run that in my program.
Here's an example of a line I would create in my.txt file:
5 3 _ _ 7 _ _ _ _ (So possible solutions for the third spot would be 1,2, or 4. Then you'd continue down the line)
So to get started I need to create a 9x9 array to store my .txt file. Read in my input one line at a time, then use a StringTokenizer to break apart each value in the line. So basically I need help starting that beginning part of my program. I'm a pretty slow learner with this stuff so a little help getting me started helps out a lot, then I tend to catch on to what is going on and I can finish up from there.
Thanks Guys

I still need to loop through and rows, columns, and grid to find possible solutions but I didn't ask for help on that. I know how to set up a 2d array, but when I set it up it's not reading out my .txt file. I was going to use 'char' in my array, but I don't know how I'm going to read from that .txt file, charAt I was thinking. Then for the stringTokenizer I'm really confused on how I would break apart each value from my .txt file.So, it looks like you're panicking and trying to do everything all at once. Maybe that's why you aren't getting anywhere. You need to start small. Don't try to write the whole program in one go, but instead start with a simpler program that doesn't do the whole business. In fact, start with a really simple program that does just one thing.
What's the first thing that's necessary? You have to read your input data from a file, one line at a time. (Yes, then you have to break each of the lines into pieces, but don't get ahead of yourself.) So write a little program that only reads your input file one line at a time. To check that it's working, just write each of the lines out to the console.
Then when that's working, add another feature. That would be splitting the lines into pieces. Again, for now just write the pieces out to the console to check that it's working. Then carry on from there.

Similar Messages

  • How can i  apply this  java program for  a jsp page?

    import java.io.*;
    import java.util.*;
    public class FileProcessing
      //create a vector container  for the input variables
         Vector variables = new Vector();
      //create a vector container for the constants
         Vector constants = new Vector();
      /*create a string expression container for the equation
         as read from the file */
         String expression = " ";
      //create double result container for the final result
         double result = 0;
         public boolean processFile(String filename,String delim)
          //index for values vector
              int num_values = 0;
          //index for constants vector
              int num_constants = 0;
          //current line being read from the external file.
              String curline = " ";
          //start reading from the external file
              try
                   FileReader fr = new FileReader(filename);
                   BufferedReader br = new BufferedReader(fr);
                   while(true)
                        curline = br.readLine();
                        if(curline == null)
                             break;
                    //determine the type of current interaction
                        boolean variable = curline.startsWith("input");
                        boolean constant = curline.startsWith("constant");
                        boolean equation = curline.startsWith("equation");
                        boolean output = curline.startsWith("result");
                   //on input variables
                        if(variable)
                          StringTokenizer st = new StringTokenizer(curline,delim);
                          int num = st.countTokens();
                          int count=0;
                          while(st.hasMoreTokens())
                               String temp = st.nextToken();
                               if(count==1)
                                    byte b[]= new byte[100];
                                    System.out.println(temp);
                                    System.in.read(b);
                                    String inputval = (new String(b)).trim();
                                    variables.add(num_values,inputval);
                                    num_values++;
                               count++;
                        // on constant values
                        if(constant)
                             StringTokenizer st = new StringTokenizer(curline,delim);
                             int num = st.countTokens();
                             int count = 0;
                             while(st.hasMoreTokens())
                                  String temp = st.nextToken();
                                  if(count==1)
                                       byte b[]= new byte[100];
                                       System.out.println(temp);
                                       System.in.read(b);
                                       String cons = (new String(b)).trim();
                                       constants.add(num_constants,cons);
                                       num_constants++;
                                  count++;
                        // on equation
                        if(equation)
                             StringTokenizer st = new StringTokenizer(curline,delim);
                             int num = st.countTokens();
                             int count = 0;
                             while(st.hasMoreTokens())
                                  String temp = st.nextToken();
                                  if(count==2)
                                       this.expression = temp;
                                  count++;
              // now we are ready to evaluate the expression
                       if(output)
                          org.nfunk.jep.JEP  myparser= new org.nfunk.jep.JEP();
                          myparser.setAllowAssignment(true);
                          for(int i=1;i<variables.size()+1;i++)
                             String name = "arg"+Integer.toString(i);
                             myparser.addVariable(name,new Double(variables.get(i-1)
                                                .toString()).doubleValue());
                          for(int i=1;i<constants.size()+1;i++)
                               String name = "arg" +Integer.
                                         toString(i+variables.size());
                               myparser.addConstant(name,new Double(constants.get(i-1).toString()));
                   //output is obtained as follows
                          myparser.parseExpression(expression);
                          result = myparser.getValue();
                          System.out.println("Assay value: "+result);
              catch(Exception e)
                   System.out.println(e.toString());
              return true;
         public static void main(String[] args)
              FileProcessing fp = new FileProcessing();
              fp.processFile("input.eqn",":");
    }//my text file name is: "input.eqn" (given below)
    input:Enter Value1:arg1
    input:Enter Value2:arg2
    input:Enter Value3:arg3
    constant:arg4
    constant:arg5
    Equation:arg1+arg2+arg3
    result:

    how can i apply this java program for a jsp pagewhy do you want to do this ?
    Your program reads from a file on the disk and formats based on a patterm.
    Jsp is not intended for such stuff.
    ram.

  • Running a Java Program for every shut down of system

    Hi
    I have a java program that sends an email to the Admin of my network.
    But this is program i just want to execute for every shutdown and on of my system
    Please Tell me how to execute my java program at system shutdown time and on time..
    Thanks

    Despite your objective, this is not a Java issue. The real question is "How does one run a program just before system shutdown?"
    How you execute such an application is system dependent. Java doesn't know when the system shuts down, only when the JVM shuts down. Unless you're willing to have JVM running the entire time the system is up, you'll need native code to detect system shutdown & launch the notification app.

  • Exception while Running a Java Program for UME.

    Hi Experts,
                           I am trying to run a java program to acess UME. Its a sample to create user but all of my samples are throwing this exception in NWDS  (Console).Can anyone tell me why is it throwing this exception .
    com.sap.security.api.UMRuntimeException: UME factory 'com.sap.security.api.IUserFactory' cannot be accessed because UME initialization has not started yet.
    Please check
            UMFactory.isInitialized() before using UME functionality.
        at com.sap.security.api.UMFactory.checkInitialized(UMFactory.java:1019)
        at com.sap.security.api.UMFactory.getUserFactory(UMFactory.java:801)
        at Search.main(Search.java:25)
    Exception in thread "main"
    Thanks in advance
    Somil

    Hi,
    Earlier i faced the same exception when i tried to call the UME form Standalone java application,To resolve this i used stateless session bean approach. i follow the Below Mentioned Steps,
    1:-- create an J2EE -- EJB module project.
    2:-- Create stateless session bean and define the require methods ,implement Local and remote interface methods  in your bean class.
    3:-- refer the UME apis in EJB Projects build path.
    4:-- Call UME in Bean class methods.Build the EJB project and Archive.
    5:--Now create an Enterprise application Project ,Include the EJB module project to your EA Project by right clicking on EA project.Build EA project and EAR file
    6:--Deploy the EAR file on your server.
    7:--Now from your standalone java application include these two projects in Project tab of your Application.
    8:--Lookup the stateless session bean in your java class by its default JNDI name ,Obtain remote or local Home interface,And execute the BEAN Method which deals with UME.
    You can also refer this tutorial in some parts of it UME apis(like IUser,UMFactory) are used in Servelets and EJB ,You can download this tutorial source from SDN for your reference.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/297f35cf-0201-0010-00b2-fe2f3e23d360
    Siddharth

  • The JAVA program for "Philosopher Problem"

    When I learn the book of "Operating Systems (Design and Implementation)"(written by Andrew S.Tanenbaum), I try to write a program for the "Philosopher Problem" . In the book there is a sample of this problem in C language, and I write it in JAVA. The following is my program, I have tested it. It is correct, but maybe it is not the most efficient way to solve the problem. Can you think out a more efficient program in JAVA to solve this problem?
    * Philosopher Eating Problem
    * @author mubin
    * @version 1.0
    public class PhilosopherEating {
    //Philosophers' number
    private final static int PHER_NUM = 20;
    //Philosophers' state
    private volatile static int[] pherState = new int[PHER_NUM];
    //THINKING
    private final static int THINKING = 0;
    //HUNGRY
    private final static int HUNGRY = 1;
    //EATING
    private final static int EATING = 2;
    //Philosophers thread group
    public static Philosopher[] philosophers = new Philosopher[PHER_NUM];
    //finish indicator
    public volatile static boolean finished =false;
    //thread lock
    public static Object threadLock = new Object();
    public PhilosopherEating() {
    * Philosopher class
    * @author mubin
    * @version 1.0
    public static class Philosopher extends Thread{
    int pherNo ;
    public Philosopher(int no){
    this.pherNo = no;
    public void run(){
    while(!PhilosopherEating.finished){
    think();
    takeForks(this.pherNo);
    eat();
    putForks(this.pherNo);
    * Thinking
    private void think(){
    System.out.println("Philosopher"+this.pherNo+"is thinking...");
    try {
    Thread.sleep( (int)(Math.random()*100));
    }catch (Exception ex) {
    ex.printStackTrace(System.out);
    * Eating
    private void eat(){
    System.out.println("Philosopher"+this.pherNo+"is eating...");
    try {
    Thread.sleep( (int)(Math.random()*100));
    }catch (Exception ex) {
    ex.printStackTrace(System.out);
    * Take the fork
    private void takeForks(int no){
    //System.out.println("takeForks:no:"+no);
    synchronized (threadLock) {
    pherState[no] = HUNGRY;
    testPher(no);
    * Put down the fork
    private void putForks(int no){
    //System.out.println("putForks:no:"+no);
    synchronized (threadLock) {
    pherState[no] = THINKING;
    if( pherState[getLeft()]==HUNGRY ){
    philosophers[getLeft()].interrupt();
    if( pherState[getRight()]==HUNGRY ){
    philosophers[getRight()].interrupt();
    * Return the NO. of philosopher who is sitting at the left side of this philosopher
    * @return the NO. of the left philosopher
    private int getLeft(){
    int ret = (pherNo-1)<0? PHER_NUM-1 : (pherNo-1);
    return ret;
    * Return the NO. of philosopher who is sitting at the right side of this philosopher
    * @return the NO. of the right philosopher
    private int getRight(){
    int ret = (pherNo+1)>=PHER_NUM ? 0 :(pherNo+1);
    return ret;
    private void testPher(int no){
    while(true){
    if(pherState[no]==HUNGRY
    &&pherState[getLeft()]!=EATING
    &&pherState[getRight()]!=EATING) {
    pherState[no] = EATING;
    //Print and check the philosophers' state
    printPher(pherState);
    return;
    }else{
    try {
    System.out.println(" Philosopher "+this.pherNo+"is waiting a fork");
    threadLock.wait();
    }catch (java.lang.InterruptedException ex) {
    System.out.println(" Philosopher "+this.pherNo+"is interrupted and woken up to take fork");
    //when it is interrupted, do nothing. Just let it continue!
    }//end of while(true)
    * Print and check the philosophers' state.
    * To insure there are no two philosophers sit side by side
    * are eating at the same time.
    private static void printPher(int[] phers){
    System.out.print(" philosophers' state��");
    for (int i = 0; i < phers.length; i++) {
    System.out.print(" "+phers);
    System.out.println("");
    for (int i = 0; i < phers.length-1; i++) {
    if (phers[i]==EATING && phers[i+1]==EATING){
    System.err.println(i+" and "+(i+1)+"two of philosophers sitted side by side are eating at the same time!");
    if (phers[0]==EATING && phers[PHER_NUM-1]==EATING){
    System.err.println("0 and "+PHER_NUM+"two of philosophers sitted side by side are eating at the same time!");
    public static void main(String[] args) {
    for (int i = 0; i < PHER_NUM; i++) {
    PhilosopherEating.pherState[i] = THINKING;
    PhilosopherEating aPhilosopherEating = new PhilosopherEating();
    for (int i = 0; i < PHER_NUM; i++) {
    philosophers[i] = new Philosopher(i);
    philosophers[i].start();
    try {
    Thread.sleep(30000);
    catch (InterruptedException ex) {
    ex.printStackTrace(System.out);
    //End all the threads of philosophers
    PhilosopherEating.finished = true;

    this problem is about learning how to use threads/synchronise objects etc, the efficiency of the code isn't really an issue, if that's what you mean. As for the efficiency of the solution, it's very hard to tell how efficient it is, but as long as all the philosphers get to eat there's no problem. I haven't really scrutized your code, but I'm not sure that you have a deadlock free solution: as long as it is possible for all the phils to pick up one fork at the same time there's a problem, and it seems from your code that each philosopher will pick up "his" fork. Again, I could be wrong, I haven't really looked. If you haven't come up with a solution, try drawing it on paper and working it out, or if you're lazy a quick google will probably give you the answer, but I'm pretty sure nobody here will :)

  • Writing a java program for generating .pdf file with the data of MS-Excel .

    Hi all,
    My object is write a java program so tht...it'll generate the .pdf file after retriving the data from MS-Excel file.
    I used POI HSSF to read the data from MS-Excel and used iText to generate .pdf file:
    My Program is:
    * Created on Apr 13, 2005
    * TODO To change the template for this generated file go to
    * Window - Preferences - Java - Code Style - Code Templates
    package forums;
    import java.io.*;
    import java.awt.Color;
    import com.lowagie.text.*;
    import com.lowagie.text.pdf.*;
    import com.lowagie.text.Font.*;
    import com.lowagie.text.pdf.MultiColumnText;
    import com.lowagie.text.Phrase.*;
    import net.sf.hibernate.mapping.Array;
    import org.apache.poi.hssf.*;
    import org.apache.poi.poifs.filesystem.*;
    import org.apache.poi.hssf.usermodel.*;
    import com.lowagie.text.Phrase.*;
    import java.util.Iterator;
    * Generates a simple 'Hello World' PDF file.
    * @author blowagie
    public class pdfgenerator {
         * Generates a PDF file with the text 'Hello World'
         * @param args no arguments needed here
         public static void main(String[] args) {
              System.out.println("Hello World");
              Rectangle pageSize = new Rectangle(916, 1592);
                        pageSize.setBackgroundColor(new java.awt.Color(0xFF, 0xFF, 0xDE));
              // step 1: creation of a document-object
              //Document document = new Document(pageSize);
              Document document = new Document(pageSize, 132, 164, 108, 108);
              try {
                   // step 2:
                   // we create a writer that listens to the document
                   // and directs a PDF-stream to a file
                   PdfWriter writer =PdfWriter.getInstance(document,new FileOutputStream("c:\\weeklystatus.pdf"));
                   writer.setEncryption(PdfWriter.STRENGTH128BITS, "Hello", "World", PdfWriter.AllowCopy | PdfWriter.AllowPrinting);
    //               step 3: we open the document
                             document.open();
                   Paragraph paragraph = new Paragraph("",new Font(Font.TIMES_ROMAN, 13, Font.BOLDITALIC, new Color(0, 0, 255)));
                   POIFSFileSystem pofilesystem=new POIFSFileSystem(new FileInputStream("D:\\ESM\\plans\\weekly report(31-01..04-02).xls"));
                   HSSFWorkbook hbook=new HSSFWorkbook(pofilesystem);
                   HSSFSheet hsheet=hbook.getSheetAt(0);//.createSheet();
                   Iterator rows = hsheet.rowIterator();
                                  while( rows.hasNext() ) {
                                       Phrase phrase=new Phrase();
                                       HSSFRow row = (HSSFRow) rows.next();
                                       //System.out.println( "Row #" + row.getRowNum());
                                       // Iterate over each cell in the row and print out the cell's content
                                       Iterator cells = row.cellIterator();
                                       while( cells.hasNext() ) {
                                            HSSFCell cell = (HSSFCell) cells.next();
                                            //System.out.println( "Cell #" + cell.getCellNum() );
                                            switch ( cell.getCellType() ) {
                                                 case HSSFCell.CELL_TYPE_STRING:
                                                 String stringcell=cell.getStringCellValue ()+" ";
                                                 writer.setSpaceCharRatio(PdfWriter.NO_SPACE_CHAR_RATIO);
                                                 phrase.add(stringcell);
                                            // document.add(new Phrase(string));
                                                      System.out.print( cell.getStringCellValue () );
                                                      break;
                                                 case HSSFCell.CELL_TYPE_FORMULA:
                                                           String stringdate=cell.getCellFormula()+" ";
                                                           writer.setSpaceCharRatio(PdfWriter.NO_SPACE_CHAR_RATIO);
                                                           phrase.add(stringdate);
                                                 System.out.print( cell.getCellFormula() );
                                                           break;
                                                 case HSSFCell.CELL_TYPE_NUMERIC:
                                                 String string=String.valueOf(cell.getNumericCellValue())+" ";
                                                      writer.setSpaceCharRatio(PdfWriter.NO_SPACE_CHAR_RATIO);
                                                      phrase.add(string);
                                                      System.out.print( cell.getNumericCellValue() );
                                                      break;
                                                 default:
                                                      //System.out.println( "unsuported sell type" );
                                                      break;
                                       document.add(new Paragraph(phrase));
                                       document.add(new Paragraph("\n \n \n"));
                   // step 4: we add a paragraph to the document
              } catch (DocumentException de) {
                   System.err.println(de.getMessage());
              } catch (IOException ioe) {
                   System.err.println(ioe.getMessage());
              // step 5: we close the document
              document.close();
    My Input from MS-Excel file is:
         Planning and Tracking Template for Interns                                                                 
         Name of the Intern     N.Kesavulu Reddy                                                            
         Project Name     Enterprise Sales and Marketing                                                            
         Description     Estimated Effort in Hrs     Planned/Replanned          Actual          Actual Effort in Hrs     Complexity     Priority     LOC written new & modified     % work completion     Status     Rework     Remarks
    S.No               Start Date     End Date     Start Date     End Date                                        
    1     setup the configuration          31/01/2005     1/2/2005     31/01/2005     1/2/2005                                        
    2     Deploying an application through Tapestry, Spring, Hibernate          2/2/2005     2/2/2005     2/2/2005     2/2/2005                                        
    3     Gone through Componentization and Cxprice application          3/2/2005     3/2/2005     3/2/2005     3/2/2005                                        
    4     Attend the sessions(tapestry,spring, hibernate), QBA          4/2/2005     4/2/2005     4/2/2005     4/2/2005                                        
         The o/p I'm gettint in .pdf file is:
    Planning and Tracking Template for Interns
    N.Kesavulu Reddy Name of the Intern
    Enterprise Sales and Marketing Project Name
    Remarks Rework Status % work completion LOC written new & modified Priority
    Complexity Actual Effort in Hrs Actual Planned/Replanned Estimated Effort in Hrs Description
    End Date Start Date End Date Start Date S.No
    38354.0 31/01/2005 38354.0 31/01/2005 setup the configuration 1.0
    38385.0 38385.0 38385.0 38385.0 Deploying an application through Tapestry, Spring, Hibernate
    2.0
    38413.0 38413.0 38413.0 38413.0 Gone through Componentization and Cxprice application
    3.0
    38444.0 38444.0 38444.0 38444.0 Attend the sessions(tapestry,spring, hibernate), QBA 4.0
                                       The issues i'm facing are:
    When it is reading a row from MS-Excel it is writing to the .pdf file from last cell to first cell.( 2 cell in 1 place, 1 cell in 2 place like if the row has two cells with data as : Name of the Intern: Kesavulu Reddy then it is writing to the .pdf file as Kesavulu Reddy Name of Intern)
    and the second issue is:
    It is not recognizing the date format..it is recognizing the date in first row only......
    Plz Tell me wht is the solution for this...
    Regards
    [email protected]

    Don't double post your question:
    http://forum.java.sun.com/thread.jspa?threadID=617605&messageID=3450899#3450899
    /Kaj

  • Java-Program for JCO-Connection

    Hallo experts!
    I tried to get a Java-Program running which should establish JCO-Connection to a SAP-System and got the following error message:
    java.lang.ExceptionInInitializerError: JCO.classInitialize(): Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'
    JCO.nativeInit(): Could not initialize dynamic link library librfc. Found version "640.0.144" but required at least version "640.0.161".
         at com.sap.mw.jco.JCO.<clinit>(JCO.java:776)
         at JCOTEST.main(JCOTEST.java:24)
    Exception in thread "main"
    Anyone got an idea?
    Thanks for your help in advance.

    Thank you Jens,
    it worked fine with the newest JCo-Download.
    Now I seem to have some Network problem: ip not reached:
    com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: Connect to SAP gateway failed
    Connect_PM  GWHOST=10.251.24.10, GWSERV=sapgw10, ASHOST=10.251.24.10, SYSNR=10
    LOCATION    CPIC (TCP/IP) on local host
    ERROR       partner not reached (host 10.251.24.10, service 3310)
    I need to talk to our network manager in the firm.
    Regards.
    Thomas

  • Java program for installing font on windows

    Hi,
    I want to write a java program that installs required fonts on windows machine. On my machine windows is installed on "C:\WINDOWS" directory.
    So, naturally "c:\WINDOWS\Fonts" directory I want to paste my font files.
    I am writing file handling code for the same. But, how to know dynamically the location of windows installation directory?
    I tried using System.getProperty("windir"), but it is not working?
    Can somebody help me?
    regards,
    Anand

    1) Use VB
    2) Who said that such a property exists?
    3) In Java 1.5, use System.getEnv()

  • JSP Unable to Load Class (posted in Java Programming for 5 Dukes)

    I hope this isn't a violation of forum etiquette, but I posted my question in Java Programming at http://forum.java.sun.com/thread.jsp?forum=31&thread=203255
    I realize now that it may have been wiser to post it here, but I have some replies already and it makes more sense just to inlcude the link.
    Can anyone assist with the question at http://forum.java.sun.com/thread.jsp?forum=31&thread=203255
    It's worth 5 dukes.

    Try changing <tagclass>E:\Tomcat324\jakarta-tomcat-3.2.4\webapps\examples\WEB-INF\classes\tags.ExampleTag</tagclass> to <tagclass>tags.ExampleTag</tagclass>
    because <tagclass> tag is for the class name and not the location of class file
    And make sure your ExampleTag.class file is in
    \WEB-INF\classes\tag\ExampleTag.class
    B!

  • Hi i wrote a java program for scanning a system for java.exe 's

    hi ,
    i wrote a program which scans the system for java.exe 's and then it captures them in a linked list and then i
    iterate through it for "\\Java\\jdk1.5.0_08\\bin\\java.exe and my aim is to return true in case the linked list contains the string "\\Java\\jdk1.5.0_08\\bin\\java.exe" and stop scanning the system.
    If the linked list does not contain "Java\\jdk1.5.0_08\\bin\\java.exe" it should return false.
    But my problem is the program is continuing to scan the system even if the linked list has "\\Java\\jdk1.5.0_08\\bin\\java.exe"
    Any sort of help is appreciated.
    The code is as follows:
    package com.installanywhere.exper;
    import com.zerog.ia.api.pub.CustomCodeRule;
    import com.installanywhere.exper.SearchTool;
    * @author
    public class eFileTool extends CustomCodeRule {
         /* (non-Javadoc)
         * @see com.zerog.ia.api.pub.CustomCodeRule#evaluateRule()
         @Override
         public boolean evaluateRule() {
              // TODO Auto-generated method stub
              SearchTool searchtool=new SearchTool();
              boolean valueTocheckfor=false;
              valueTocheckfor=searchtool.find();
              String someothervalue=Boolean.toString(valueTocheckfor);
              if(someothervalue.equalsIgnoreCase("true")){
                   return true;
                   //System.exit()
              else if(someothervalue.equalsIgnoreCase("false")){
                   try {
                        Thread.sleep(5000);
                   } catch (InterruptedException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
              System.out.println(valueTocheckfor+"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
              return valueTocheckfor;
    The code of search tool is
    package com.installanywhere.exper;
    import java.io.*;
    import java.util.*;
    public class SearchTool
         * @param args
    static     boolean valuesToReturn=false;
    static     boolean anothervalueToRefer=false;
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              SearchTool           t = new SearchTool();
              System.out.println("xxxxxxxxxxxxxxxxxxxx");
              boolean someArgument=t.find();
              System.out.println(someArgument+"iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii"+"");
                   public boolean find()
                        System.out.println("2222222222222222222");
                   boolean someThing=searchcomp("java.exe");
                   System.out.println(someThing+"inside the othere one");
                   return someThing;
              public boolean searchcomp(String file)
                   System.out.println("3333333333333333333333");
                   File[] drives=File.listRoots();
                   boolean valueIdentified=false;
                   for (int ctr=0;ctr<(drives.length-1);ctr++)
                        valueIdentified=search(drives[ctr],file);
                        System.out.println("4444444444444444444");
                   System.out.println(valueIdentified+"something i need to accomplish");
                   return valueIdentified;
                   public boolean search(File dir,String file)
                   File[] directories=dir.listFiles();
              System.out.println("55555555555555555555555");
                   if (directories == null)
                        System.out.println("666666666666666666666666");
                   return false;
                   for(int ctr=0;ctr<directories.length;ctr++)
                        if(directories[ctr].isDirectory())
                             System.out.println("77777777777777777777777777");
                             valuesToReturn=search(directories[ctr],file);
                             System.out.println(valuesToReturn+"india is great");
                        else
                             if(directories[ctr].getName().equals(file))
                                  String path = directories[ctr].getAbsolutePath().toString();
                                  System.out.println(path);
                                  List someList=new LinkedList();
                                  anothervalueToRefer=allPaths(path);     
                                  System.out.println(anothervalueToRefer+"god damn it");
                                       //System.out.println(anothervalueToRefer+"let me seeeeeeeeeeeeeeeeeee");                                        
                                  return anothervalueToRefer;
                   return valuesToReturn;
                   public boolean allPaths(String allPath)
                        List l=new LinkedList();
                        String somepath=allPath;
                        l.add(somepath);
                        //return l;
    /*if(l.contains("C:\\Program Files\\Java\\jdk1.5.0_08\\bin\\java.exe")){
                             System.out.println("yepeeeeeeeeeeeeee");
                             //System.exit(0);
    else{
         System.out.println(" the face");
                        ListIterator li = l.listIterator();
                        System.out.println("inside the method of all paths");
                        if(li.hasNext())
                             if(li.next().toString().contains("\\Java\\jdk1.5.0_08\\bin\\java.exe"))
                             System.err.println(somepath+"this is the path i wanted to resolve correctly");                         
                             return true;
                             else{
                                  System.out.println("trueeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee");
                                       return false;
                        else {
                                  return false;
         }

    A good place to ask advice about web development is at the MozillaZine "Web Development/Standards Evangelism" forum.
    *http://forums.mozillazine.org/viewforum.php?f=25
    The helpers at that forum are more knowledgeable about web development issues.<br>
    You need to register at the MozillaZine forum site in order to post at that forum.

  • Is it possible to develop an Iphone App that will run a .jar on the users PC? (the APP's only goal is to distribute what is actually a java program for a PC)

    So yeah, I've built myself a killer tool for PC's. And in my search for a nice way to distribute this must-have tool, I am considering using the Istore. Hence, my question.
    What I am looking for is a simple App, and all it does is put this .jar file on the users PC. And maybe activate it too, so that the user doesnt have to double click it. And OK, maybe first check whether the user's got java installed, and otherwise prompt him to do so.
    Would this be possible? Is there anyone who would like to do this for me? If so I'd be glad to hear at what cost?
    Regards,
    Olivier

    Since the only connection between the PC and the iPhone is through iTunes, no.

  • Java programing for Mobile devices on OS X

    im completly new to java, and very interseted in getting started with developing for mobile devices..
    i have experience with other languages (C#.NET, a little VB.NET, BaSH, Ruby, Python...)
    but i dont really know were to start..
    what do i need to create, compile, and use java aps on mobile devices
    Also, im using OS X 10.4, so i would need someting mac compatible...
    (i have an HTC S710 with Windows Mobile 6.0)
    Message was edited by:
    maxtors

    Hi java is platform independent , so dont worry about support on MAC etc.
    what i would suggest is before thinking of coding for mobiles learn core java. Install editors like netbeans,eclipse and understand the languages.
    The folowing links will help you
    http://java.sun.com/docs/books/tutorial/
    FYI java has Java ME platform for developing application on mobiles
    Vijay

  • How to begin learing Java Programming for the Internet?

    expecially for socket

    Just go to www.google.com and search for java+server+client+socket
    And then look at some source code...

  • JDBCDataSourceRuntime Information for Weblogic 10.3 using Java program

    Hello All,
    I am trying to get the JDBC datasource connection pool status in Weblogic 10.3 using java program - if it is in RUNNING state or Shutdown state.
    Can someone provide me with the same java program for achieving this.
    - - Tarun

    Refer to this Doc ......... It may help you.
    http://download.oracle.com/docs/cd/E12839_01/web.1111/e13728.pdf

  • How to get the output of a C prgram to Java to the parent Java program

    Hi,
    Suppose there is a Java Program which calls inside it the C program.The C program outputs as below
    printf("%c%c",c1,c2);
    Now I have to take this output as an input of the Java Program for further processing.How can I do this?
    Tapas

    By reading from the output stream of the C program.
    (if you're not already reading the output stream of the program anyway, you should be - http://java.sun.com/developer/JDCTechTips/2005/tt0727.html#2 )
    The format is a char, a space, a char, so just call read() three times and ignore the second value.

Maybe you are looking for

  • Clear vendor items where clearing was reversed

    Hi All, When clearing vendor open items in F-44 - Process Open items - There are not available those open items on which clearing was reversed. Does anyone have idea where could be the problem. Many thanks in advance, Jan

  • Custom Exchange Rate Type for Purchase Order

    Hi Our Financial Team doesn't want to change the Exchange Rates on a daily basis, but for place purchase orders with our overseas vendors we need the daily spot rate loaded in the system.  Is there way to configure a different exchange Rate type ?  a

  • Reg. Stock account instead of consumption account

    Dear Experts Pls consider my below scenario When PR and PO creating material is posted to consumption account automatically,but our company needs to be posted stock account with account assignment category E. I am struggling for 6 months no one is gi

  • 0x80004005: app install failed - OSD SCCM 2012 R2 - randomly

                     Hi, I have visited many forums with this error before posting. Problem : During TS New computer OSD, app failed to install randomly on all model Win 7 x86 or x64. Information : App concerned : Adobe flash, office, chrome... Domain in

  • HP 5210 Webcam

    I bought a HP 5210 Webcam. The white balance doesn't work using this Webcam. I called HP support and they don't know why it doesn't work. HP sent me another HP 5210 Webcam and the white balance doesn't work on that also. I have tried using both of th