Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

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

Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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

Shaan Patil
Posts: 22567
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic