-
Notifications
You must be signed in to change notification settings - Fork 5
Windows Setup: Basic Help
This guide requires that you have privileges on your computer, and are comfortable with basic command line navigation. (For the test program to run without error, you need to edit the username, api_key, and api_secret, to be your own.)
If you receive the following error during testing the file, please follow the small guide below:
C:\Users\Zack\Desktop>javac test.java
'javac' is not recognized as an internal or external command,
operable program or batch file.
-
This error means you need to download the Java JDK (Java Developer Kit) for your computer, it is a free download from Oracle.
-
If you have Windows 32 bit, get the x86 download. If you have Windows 64 bit, get the x64 download. Remember which version you get for a later step (If you are unsure, get the x86 download, because it is backwards compatible), you can find it here:
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
-
Once that is installed, you can spam click the next button, we need to set the class path, so your computer knows what Java is.
-
Open up command prompt and type: (Notice: The JDK version may vary, depending when you access this file, the current version is 1.7.0_45 on 2 January 2014.)
set path=C:\Program Files\Java\jdk1.7.0_45\bin
- Now we need to compile the files to allow them to execute. Both the Java API and test.java program need to be located in the same place: in command prompt, navigate to the location of the API and test, and in type:
javac test.java
- Once the test program is compiled, it will generate 2 .class files. Once the .class files are created, in command prompt, type:
**WARNING, you will get a LARGE amount of output. The test.orderbook() and test.trade_history()
functions, both return alot of data. For the sake of testing this, I would recommend commenting
out these functions in the file: test.java**
java test
- Open test.java with notepad, and find the lines:
// Fetch the order book data, for the currency pair.
System.out.println("\nTesting the \"GHS/BTC\" order_book..!");
System.out.println(test.order_book("GHS/BTC"));
// Fetch the trade history data, for the currency pair.
System.out.println("\nTesting the \"GHS/BTC\" trade_history..!");
System.out.println(test.trade_history("GHS/BTC", 1));- In front of the 4 lines that start with "System", add a double forward-slash: // The resulting lines will look like this:
// Fetch the order book data, for the currency pair.
//System.out.println("\nTesting the \"GHS/BTC\" order_book..!");
//System.out.println(test.order_book("GHS/BTC"));
// Fetch the trade history data, for the currency pair.
//System.out.println("\nTesting the \"GHS/BTC\" trade_history..!");
//System.out.println(test.trade_history("GHS/BTC", 1));Hope this small guide helped resolve your problems, Zack.