​How to retrieve UI from java class in a scala project?

My project is in scala. I have some classes in java that i do not want to migrate to scala.
And i
do not want to use the Add-ons
i prefer have a direct contact with Vaadin Framework, Spring Framework (i18n, Security, Neo4J). For that moment all is running very well.

Sometimes i need to access variables declared in the init class

“class myprojectUI extends UI {” (my init class is in scala)

In a java class of my project i declared the UI instance like

final myprojectUI current = (myprojectUI) UI.getCurrent();

and i access my function with current.myfunction(“myparameters”)

Sometimes in the eclipse ide kepler this works well

But if i make maven clean install i got an error that it “cannot find symbol” at that line
import com.mydomaine.myprojectUI

i would like to know how to retrieve the instance of the UI (initialised in scala) in my java class
And what sometimes i acces sometimes not in the eclipe ide

Vaadin version: 7.1.6
Scala version: 2.10.2
Scala Maven Plugin: 3.1.6
Eclipse version: Kepler

On the ide when i run the command mvn clean and after mvn install i got the error
After if i run the command run as i got again the error

But if i open a file and i do any modification on the source file and then again i run the command run as all is correct… i can get my UI instance from java

If i comment the line i produce the war file. My java files and scala files are mixed in the same package.

This will become a severe error because i cannot produce the war file.



Ok that’s running now!
This link help me very well

Put your java class and scala class in the same repertory. Don’t separate them in two package main.java and main.scala
The problem was that the scala compiler can compile all scala code and java code. It can see the function java in java class. But the compiler java cannot find scala function. We have to learn it how to do.
Do not forget to change your pom like the link does otherwise you compile twice the java class