braintree / braintree_java

Braintree Java library
https://developer.paypal.com/braintree/docs/start/overview
MIT License
158 stars 98 forks source link

unable to compile project error class not found com.braintreegateway.BraintreeGateway #68

Closed sreexamus closed 5 years ago

sreexamus commented 5 years ago

General information

Issue description

crookedneighbor commented 5 years ago

There's not much to go on here. Please contact our support team for help with your integration: https://help.braintreepayments.com/

sreexamus commented 5 years ago

am using java 8.5 and tomcat 8 server with latest version of braintree jar 2.91.0. i am not getting compilation error as jar was detected but at run time its failing.

screen shot 2019-01-31 at 9 05 28 am
crookedneighbor commented 5 years ago

Can you provide a piece of your integration? Or a simple repo that reproduces the issue you are seeing? It works fine for me:

// app.java
import com.braintreegateway.*;

public class app {
    private static BraintreeGateway gateway = new BraintreeGateway(
        Environment.SANDBOX,
        "merchant-id",
        "public-key",
        "private-key"
    );

    public static void main(String[] args) {
        CustomerRequest request = new CustomerRequest()
            .paymentMethodNonce("fake-valid-nonce")
            .firstName("First")
            .lastName("Last");

        Result<Customer> result = gateway.customer().create(request);

        Customer customer = result.getTarget();

        System.out.println(customer.getId());
    }
}

And then to run it:

javac -cp '.:braintree.jar' app.java && java -cp '.:braintree.jar' app
crookedneighbor commented 5 years ago

Closing this due to inactivity.