Giter VIP home page Giter VIP logo

myjohndeereapi-oauth-java-client's Introduction

MyJohnDeereAPI-OAuth-Java-Client

System Requirments

Download Java JDK 1.7 or higher, set the JAVA_HOME variable, adjust memory settings, and download and install Apache Maven.

Set the JAVA_HOME Variable:

  1. Right-click the My Computer icon on your desktop and select Properties.
  2. Click the Advanced tab.
  3. Click the Environment Variables button.
  4. Under System Variables, click New.
  5. Enter the variable name as JAVA_HOME.
  6. Enter the variable value as the installation path for the Java Development Kit.
    • If your Java installation directory has a space in its path name, you should use the shortened path name (e.g. C:\Progra~1\Java\jdk1.7.0_25\jre) in the environment variable instead.
    • Note for Windows users on 64-bit systems:
      • Progra~1 = 'Program Files'
      • Progra~2 = 'Program Files(x86)'
  7. Click OK and then click Apply Changes.
  8. Close any command windows that were open before you made these changes and open a new command window. There is no way to reload environment variables from an active command prompt. If the changes do not take effect after reopening the command window, restart Windows.
  9. Run the command. You will see the following on the screen:

java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

Adjust memory settings to increase available Java memory or a fix a "Perm Gen Out of Memory" issue:

  1. Right-click the My Computer icon on your desktop and select Properties.
  2. Click the Advanced tab.
  3. Click the Environment Variables button.
  4. Under System Variables, click New.
  5. Enter the variable name JAVA_OPTS
  6. Enter the variable value as -Xmx1024m -XX:MaxPermSize=512m
  7. Click OK and then click Apply Changes.

Download & Install Apache Maven

  1. Download and Install at least version 3.2 of Maven.
  2. Unzip the distribution archive (i.e. apache-maven-3.0.5-bin.zip) to the directory you wish to install Maven 3.0.5. These instructions assume you chose C:\maven\.
  3. Right-click the My Computer icon on your desktop and select Properties.
  4. Click Advanced System Settings, and then click on Environment Variables.
  5. Add the following new system variables:
Name Value
M2_HOME <path to maven root dir; eg c:\maven\>
M2 %M2_HOME%\bin
MAVEN_OPTS -Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m -Xss10m

Edit the path environmental variable and add the M2 var to it: ...;%M2%;. Then open a terminal and run mvn --version to verify the installation.

Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da;
Maven home: C:\maven\apache-maven-3.0.5
Java version: 1.7.0_67, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_67\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

Set up and run the sample app:

  1. Copy the App ID and Shared secret of your App from developer.deere.com to CLIENT variable in ApiCredentials.java.
  2. Run the command mvn clean compile test install package to clean, compile, test, install and package the code.
  3. Run the command mvn exec:java -Dexec.mainClass="com.deere.democlient.GetOAuthToken"
  4. The system will then show this message:

Please provide the verifier from https://my.deere.com/consentToUseOfData?oauth_token={the request token generated by the given App Id and Secret in the Get Oauth Token code}

Copy the URL to a browser and login to MyJohnDeere using your MyJohnDeere username and password. The browser will then display the Verifier Code

Copy the verifier code just below the system message in the command prompt and hit "Enter". This will generate the oAuth token and secret, as shown below:

Token: {a token}
Token Secret: {a token secret}

Copy this token and secret and pass it as a constructor argument to OAuthToken TOKEN = new OAuthToken("a token ", " a token secret "); in the ApiCredentials class. Then run the command to build Maven again:

mvn package

You can run the partnerships class using the below command:

mvn exec:java -Dexec.mainClass="com.deere.democlient.apis.Partnerships"

myjohndeereapi-oauth-java-client's People

Contributors

dv30371 avatar joshuajcarson avatar kadiyalasrividya avatar lucas-golinghorst avatar mjnivarel avatar mp18735 avatar raviyerramsetty avatar ryber avatar tpravin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.