Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

From NetBeans to standalone
 Post subject: From NetBeans to standalone Post rating: 0   New post Posted: Mon 12 Dec, 2016, 17:24 
User avatar

User rating: 2
Joined: Fri 27 Jul, 2012, 07:04
Posts: 82
Location: Spain, Paracuellos de Jarama
Hello,

I'm a very unexperienced newcomer to Java development.

Following the instructions in:

Home>Development>Get Started API>Use in JForex SDK>Use In NetBeans>Maven tutorial

https://www.dukascopy.com/wiki/en/development/get-started-api/use-jforex-sdk/use-in-netbeans/Maventutorial

I could compile/run a strategy in NetBeans and everything looks nice.

Now I'd like to run the strategy in the MS Windows 8.1 Command Prompt.

But I don't know how to deploy the strategy to run without NetBeans

So far what I've done is right-clicking the Maven Project JForex-SDK in NetBeans and selecting "Build with Dependencies" option.

A folder with the name 2.45.61 has been generated, it contains three files:

JForex-SDK-2.45.61.jar
JForex-SDK-2.45.61.pom
_maven.repositories

I've sent the command: java -cp JForex-SDK-2.45.61.jar singlejartest.Main

and I've got this error:

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: com/dukascopy/api/system/ISystemListener
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
        at java.lang.Class.privateGetMethodRecursive(Unknown Source)
        at java.lang.Class.getMethod0(Unknown Source)
        at java.lang.Class.getMethod(Unknown Source)
        at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)
        at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.dukascopy.api.system.ISystemListener
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 7 more


Please can you help me to run the strategy from the Command Prompt?

Cheers

Francisco


 
 Post subject: Re: From NetBeans to standalone Post rating: 0   New post Posted: Wed 14 Dec, 2016, 17:17 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
To run the strategy from jar the project needs to be compiled with dependencies.
To do that use the attached pom.xml. To build the project use command
java -cp JForex-SDK-2.45.61-jar-with-dependencies.jar singlejartest.Main


Attachments:
pom.xml [7.16 KiB]
Downloaded 237 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: From NetBeans to standalone Post rating: 0   New post Posted: Fri 16 Dec, 2016, 05:07 
User avatar

User rating: 2
Joined: Fri 27 Jul, 2012, 07:04
Posts: 82
Location: Spain, Paracuellos de Jarama
Thanks for your help. I will try this...


 

Jump to:  

  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com