473,406 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Runtime Error

this is my runtime error:
java.lang.NoSuchMethodError: Location: method <init>()V not found
at driver.main(driver.java:5)

this is my code for my first .java file:
Expand|Select|Wrap|Line Numbers
  1. public class driver
  2. {
  3.     public static void main(String args[])
  4.     {
  5.         Location test = new Location();
  6.         System.out.println(test.getX());
  7.     }
  8. }
  9.  
this is my code for my second .java file:
Expand|Select|Wrap|Line Numbers
  1. public class Location
  2. {
  3.     private int x;
  4.     public Location()
  5.     {
  6.         x = 0;
  7.     }
  8.     public int getX()
  9.     {
  10.         return x;
  11.     }
  12. }
  13.  
other info:
I am using BlueJ on WindowsXP.
The java files are in the same folder with all the other files that are created with BlueJ.
Sep 12 '06 #1
2 2914
PLA
44
this is my runtime error:
java.lang.NoSuchMethodError: Location: method <init>()V not found
at driver.main(driver.java:5)

this is my code for my first .java file:
Expand|Select|Wrap|Line Numbers
  1. public class driver
  2. {
  3.     public static void main(String args[])
  4.     {
  5.         Location test = new Location();
  6.         System.out.println(test.getX());
  7.     }
  8. }
  9.  
this is my code for my second .java file:
Expand|Select|Wrap|Line Numbers
  1. public class Location
  2. {
  3.     private int x;
  4.     public Location()
  5.     {
  6.         x = 0;
  7.     }
  8.     public int getX()
  9.     {
  10.         return x;
  11.     }
  12. }
  13.  
other info:
I am using BlueJ on WindowsXP.
The java files are in the same folder with all the other files that are created with BlueJ.
It runs ok for me !
Sep 13 '06 #2
Oh, about this.... I fixed it awhile back. The problem was that I was importing a .jar to my java files which had a predefined 'Location' class of its own. So when I ran my program, it was using the predefined class instead of mine and gave an error because I wasn't using the predefined Location's constructor properly. It was an easy fix when I just change my Location class name to something else not predefined. I hope this helps others who have this weird problem, for it took me too long to figure it out.
Sep 20 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Bob Bamberg | last post by:
Hello All, I have been trying without luck to get some information on debugging the Runtime Error R6025 - Pure Virtual Function Call. I am working in C++ and have only one class that is derived...
5
by: Nathan Bloom | last post by:
Hi, I have a secured database that runs fine on the computer the database is installed on. I have several workstations with access runtime installed that also need access to the database. ...
2
by: Paul | last post by:
I'm hoping someone can help me with the problem. I have a database where the default value for a date field in a table is =date() This works perfectly in my table and on my form. But when I...
12
by: Markus Ewald | last post by:
I'm just experimenting around with the VisualC++ 2005 Express Edition Beta and found some strange behavior for which I can't seem to find a workaround. What I've done is set up two static library...
0
by: Kirk | last post by:
I'm trying to use a Web Service to be a Remoting client of an existing ..NET 2.0 server. But I get the following error when I try to use System.Runtime.Remoting.Channels.Http in my WebService. ...
0
by: zfraile | last post by:
I'm getting this error from the JIT compiler at runtime, but only on my boss' machine, not my development machine. I believe the error is generated from a call to an Excel object, but I can't tell...
0
by: Yelena Varshal via AccessMonster.com | last post by:
Hello We have a shortcut for our MS ACCESS application that uses a /Runtime switch because we may have some users that use Runtime. The application worked fine in Access 2000 and was tested with...
7
by: Norman Diamond | last post by:
A project depends on VC runtime from Visual Studio 2005 SP1, and DotNet Framework 2. Options are set in the setup project properties, so if these two dependencies are not already installed then...
3
by: Jim Armstrong | last post by:
Hello all - This is driving me crazy. I have a table called tblClients - very simple, has the following fields: taxID (PK) ClientName SalesName The main form of my application allows a...
1
by: BL3WC | last post by:
Hi, I'd created a MDE under Access 2003. It is now under testing stage. Some of the users will use Access 2003 runtime and some will use Access 2007 runtime to run this MDE. I installed the...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.