I have a Java file that looks like this:
package AuthorizeNetFingerprint;
class Fingerprint {
private static Log logger = LogFactory.getLog(Fingerprint
I am not familiar with the Play framework, but the first line in your Scala sample code should instantiate the class AuthorizeNetFingerprint.Fingerprint
, which only has a private constructor and is not a public class (i.e., it can only be accessed from the same package).
Maybe a call to AuthorizeNetFingerprint.Fingerprint.createFingerprint(...)
works, after making the class public
?
It's conventional to name Java packages in all lower case.
It also appears that Scala gets confused if you try to use a Java package that starts with upper case. If you use authorize
as the package name instead of AuthorizeNetFingerprint
, it will compile.
Also, there's no need for this:
val fingerprint = new AuthorizeNetFingerprint.Fingerprint
createFingerprint
is a static method, so just call
val x_fp_hash = Fingerprint.createFingerprint
(after importing authorize.Fingerprint
).
Three things:
All the Scala code in your example should be replaced by:
val x_fp_hash = AuthorizeNetFingerprint.Fingerprint.createFingerprint(…)
This works in the Scala (2.9.1) console, compiled with sbt (0.11.3).
Yes, you can mix Java and Scala in a Play2 application, just put the Java code in the app directory. Note that Java classes need to be in their corresponding package directories, which is not the case for Scala classes.
In theory this should work just fine. Check out this blog Re Java and Scala interop. http://www.codecommit.com/blog/java/interop-between-java-and-scala
When creating the project did you specify Java, Scala or None (1,2 or 3)