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

  • SEARCH
  • Home
  • 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 8200531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:28:58+00:00 2026-06-07T06:28:58+00:00

>>> import sys >>> sys.path.append(/usr/local/oanda_fxtrade.jar) # add the jar to your path >>> >>>

  • 0
  >>> import sys
  >>> sys.path.append("/usr/local/oanda_fxtrade.jar") # add the jar to your path
   >>> 
  >>> import com.oanda.fxtrade.api.test.Example1 as main1
  >>> import com.oanda.fxtrade.api.test.Example2 as cancel
  main1("JPY",9,'-1')
  TypeError: main1("JPY",9,'-1'): expected 0 args; got 3

This seems no error – but really i need some args

cancel()
Thread[Thread-0,5,main]

Inside java class

  public final class Example1 extends Thread {
  private Example1() {
        super();
    }
 public static void main(String[] args) throws Exception {
FXClient fxclient  = API.createFXGame();

String username = "foo";
String password = "foo";
String sel=args[0];
String str1=args[1];
    String str2=args[2];

main1.main(“JPY 9 -1”)

TypeError: main(): 1st arg can’t be coerced to String[]

Ok I think I went to the next level

  • 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-07T06:28:59+00:00Added an answer on June 7, 2026 at 6:28 am

    After

    import com.oanda.fxtrade.api.test.Example1 as main1
    

    main1 is the class. In java executing the class will run main but that doesn’t mean you can pass args to the class.

    Try:

    main1.main(["JPY","9","-1"])
    

    EDIT:
    There were two separate issues here.

    For the subsequent error Could not initialize class com.oanda.fxtrade.api.API… it looks like you should review this question: Why does Jython refuse to find my Java package?

    calling sys.path.append to add the jar does not allow the package scanner operate which happens at load time. You should try either importing the required modules/classes manually or perhaps adding the jar to the CLASSPATH before invoking jython.

    from here I think the jython answer is in and it becomes a com.oanda.fxtrade.api question with is probably outside SO scope.

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

Sidebar

Related Questions

Firstly, here's my script: #!/usr/bin/python import sys, os sys.path.append('/home/username/python') sys.path.append(/home/username/python/flup) sys.path.append(/home/username/python/django) # more path
import sys sys.path.append('/home/myuser/svn-repos/myproject') from myproject.settings import * But, it says module not found when
So I have a main.py file inside /home/richard/projects/hello-python directory: import sys sys.path.append('/home/richard/projects/hello-python') from Encode
I thought import sys sys.path.append(/home/me/mydir) is appending a dir to my pythonpath if I
I have the following simple code: import urllib2 import sys sys.path.append('../BeautifulSoup/BeautifulSoup-3.1.0.1') from BeautifulSoup import
Can someone explain why this code: import sys sys.path.append(C:\\WINDOWS\\system32) import clr clr.AddReferenceToFile(wiimotelib.dll) works fine
tests.py import unittest import sys import os sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))) import my_module.ext print sys.path print
I have a file with this content import os import sys sys.path.append('/home/user/dj/project/') sys.path.append('/home/user/dj/') os.environ.setdefault(DJANGO_SETTINGS_MODULE,
It's weird to me that the import fails even when it's in the sys.path
Python reports an import error, even when a valid package exists on sys.path, if

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.