Switch to full style
Java2 codes,problems ,discussions and solutions are here
Post a reply

Re: Java error

Mon Dec 13, 2010 11:28 am

I feel good to know that many have similar names as that of mine..i used to thought that it is kind of least common name.... well thanks...now i have finally finished re-installing.

now too i m unable to set the permanent path of java...
i already have tried setting a path in environment variables but it still its not working so i have to set the path to bin again and again for compilation purposes...

1 more query i was running a small program and getting an error in that too...
Can u help the program is--
Code:
public class myanimallist
{
private animal[] animals = new animal[5];
private int nextindex = 0;

public void add(animal a)
{
if(nextindex < animals.length)
{
animals[nextindex] = a;
System.out.print("animal added at " + nextindex);
nextindex++;
}
}

}


public class animal
{
public static void main(String[] args)
{
myanimallist list = new myanimallist();

dog d = new dog();

cat c = new cat();
list.add(d);
list.add(c);
}
}

As i m trying to understand the polymorphism in java but i m getting 4 errors in animal class after compilation that too related with dog and cat objects or reference variables or whatsoever....



Re: Java error

Fri Jan 07, 2011 1:20 am

You must set your JAVA_HOME variable and add it to your Path.http://www.codemiles.com/posting.php?mode=reply&f=20&sid=684d69fda86e359d58e0acfd2e146819&t=6941#

Right click on My Computer, select Properties. Select Advanced. Click on the Environment Variables button.
Add a new system variable. Name it JAVA_HOME. Its value should be the path to the top of the Java install. C:\program files\java or the equivalent.

Now edit the Path variable and add the following to the end - ;%JAVA_HOME%\bin

Save the changes.
Start a command window (Start:Run:cmd:enter) or Programs:Accessories:DOS command window). Type java -version and press enter. If you get bad command or filename, you did not set the JAVA_HOME correctly.

Re: Java error

Fri Jan 07, 2011 1:23 am

:rules: :anno: You must set your JAVA_HOME variable and add it to your Path.

Right click on My Computer, select Properties. Select Advanced. Click on the Environment Variables button.
Add a new system variable. Name it JAVA_HOME. Its value should be the path to the top of the Java install. C:\program files\java or the equivalent.

Now edit the Path variable and add the following to the end - ;%JAVA_HOME%\bin

Save the changes.
Start a command window (Start:Run:cmd:enter) or Programs:Accessories:DOS command window). Type java -version and press enter. If you get bad command or filename, you did not set the JAVA_HOME correctly.

Post a reply
  Related Posts  to : Java error
 Java download error     -  
 Error 500: java.lang.NoClassDefFoundError: org.apache.common     -  
 ERROR     -  
 Deliberate Error     -  
 Check DNS error     -  
 skymiles error     -  
 error in code     -  
 How do I use php in my 404 error page for my site?     -  
 Understanding PHP error messages     -  
 error in inserting record     -