Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7890253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:18:27+00:00 2026-06-03T06:18:27+00:00

I am trying to use Joda Time in Java on Windows. I’ve downloaded Joda

  • 0

I am trying to use Joda Time in Java on Windows. I’ve downloaded Joda Time 1.2 and put the JAR on my CLASSPATH:

PS D:\Java\Jars> $env:CLASSPATH
.;C:\Program Files\Java\jre6\lib\ext\QTJava.zip;D:\Java\Jars\joda-time-2.1.jar

The following Java code works perfectly:

import org.joda.time.*;

class Foo {
    public static void main (String[] args) {
        System.out.println("Hello, world");
        DateTime d = new DateTime();
        DateTime b = new DateTime(1981,12,25,0,0);
        Period p = new Period(b,d);
        System.out.println(p.toString());
    }
}

However, when I try to import joda time from a scripting language, I get ClassNotFound errors.

Jython:

PS D:\Java\Jars> java -jar .\jython.jar
Jython 2.5.2 (Release_2_5_2:7206, Mar 2 2011, 23:12:06)
[Java HotSpot(TM) Client VM (Sun Microsystems Inc.)] on java1.6.0_31
Type "help", "copyright", "credits" or "license" for more information.
>>> from org.joda.time import DateTime
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named joda
>>> import os
>>> os.getenv("CLASSPATH")
'.;C:\\Program Files\\Java\\jre6\\lib\\ext\\QTJava.zip;D:\\Java\\Jars\\joda-time-2.1.jar'

Clojure:

PS D:\Java\Jars> java -jar .\clojure-1.4.0.jar
Clojure 1.4.0
user=> (import (org.joda.time DateTime Period))
ClassNotFoundException org.joda.time.DateTime  java.net.URLClassLoader$1.run (:-1)

How can I diagnose what is going wrong here? Presumably there is something specific to the scripting environments that is causing the issue. I know Python, but I’m not very familiar with the Java-interop aspects of Jython. I know little about Clojure beyond enough to set up the above test.

The classpath within Jython seems fine, as shown.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T06:18:29+00:00Added an answer on June 3, 2026 at 6:18 am

    You are running both programs directly out of their JAR’s:

    java -jar archive.jar
    

    Which does not use the system class path. An executable JAR must be bundled with all it’s dependencies. Try this simple alternative for testing purposes:

    java -cp "D:\Java\Jars\joda-time-2.1.jar;D:\Java\Jars\clojure-1.4.0.jar" clojure.main
    

    Which will run the Clojure command line evaluator, with the Joda Time libraries included. Something similar should be available for Jython as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the Joda-Time library with Java. I'm having some difficulty trying to turn
I'm trying to use Joda-Time in order to know time durations between two points
I'm trying to use JodaTime in Scala. So I did import org.joda.time.DateTime val dt
I am trying to use joda-time with its Scala wrapper . Saying val dt
I am trying use Google Maps for my work; I have downloaded an example
I am trying use a Java Uploader in a ROR app (for its ease
I'm trying to use ivy:publish to publish a jar that I've built to the
Trying to use Java's regexp I want to match /app, /app/.* , but not
I'm trying to use JODA to simply convert a numeric timestamp (a long representing
I'm trying use epoch time dates in my series data. The array looks like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.