Total members 10261 | Gratitudes |It is currently Wed May 23, 2012 8:55 am Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 13 posts ]  Go to page Previous  1, 2
Author Question
 Question subject: Re: Java error
PostPosted: Mon Dec 13, 2010 11:28 am 
Offline
Newbie
User avatar

Joined: Wed Dec 08, 2010 12:32 pm
Posts: 6
Has thanked: 0 time
Have thanks: 0 time

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....


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: Java error
PostPosted: Fri Jan 07, 2011 1:20 am 
Offline
Newbie
User avatar

Joined: Fri Jan 07, 2011 1:13 am
Posts: 2
Has thanked: 0 time
Have thanks: 0 time
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.


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: Java error
PostPosted: Fri Jan 07, 2011 1:23 am 
Offline
Newbie
User avatar

Joined: Fri Jan 07, 2011 1:13 am
Posts: 2
Has thanked: 0 time
Have thanks: 0 time
: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.


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 13 posts ]  Go to page Previous  1, 2
Quick reply


  

 Similar topics
 video chat application in java
 navigating to database using java
 java mobile apps
 need help in java
 Read your gmail using Java code
 Java Programing to communicating port parallel
 HELP :Novel error tolerant method AES for satelite imgaes
 Java Chat
 Steganography in java
 java code for listing folder contents from remote folder

All times are UTC [ DST ]


Users browsing similar posts

Users browsing this forum: No registered users and 4 guests



Jump to:  
Previous Question | Next Question 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team