• Post Reply Bookmark Topic Watch Topic
  • New Topic

error in while running : java.lang.NoSuchMethodError: java.lang.System.nanoTime()J  RSS feed

 
Shaan patil
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am running a standalone java program , when I run from the eclipse , I am getting the following error.
What is the solution ?
I am using JDK 1.5


java.lang.NoSuchMethodError: java.lang.System.nanoTime()J


Regards
Shaan Patil
 
Rob Spoor
Sheriff
Posts: 21131
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
nanoTime was added in Java 5.0, so it looks like your project is using the Java 1.4 libraries. Set up a new JRE for Java 5.0 in Eclipse*, and specify in the project properties to use that JRE instead of the default**.

* Choose "Window -> Preferences", select "Java -> Installed JREs", press "Add". Give the JVM a name (I usually take the Java folder name, like jre1.6.0_05) and browse for the Java home directory.

** Make sure the project is opened. Right click on the project name and select "Properties". Select "Java Build Path" and double click on the "JRE System Library". Check the "Alternate JRE" radio button and select the newly added JRE. Press OK until all dialogs are closed.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!