自动将Scala代码转换为Java代码 [英] Automatically convert Scala code to Java code

查看:879
本文介绍了自动将Scala代码转换为Java代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用Scala编写的应用程序,我的一些团队成员想要它的Java版本。它是一个演示应用程序,使用另一个用Scala编写的API,他们希望Java版本的应用程序能够使用Java中的API。但是,应用程序有点大,我不想手动重新使用Java(他们不想学习Scala)。是否有任何工具可以从Scala代码自动生成(可读)Java代码?

I have an app written in Scala and some of my team members want a Java version of it. It is a demo app to use another API written in Scala, and they want a Java version of the app to be able to use the API from Java. However, the app is somewhat large and I don't want to manually rewerite in Java (and they don't want to learn Scala). Is there any tool that will automatically generate (readable) Java code from the Scala code?

推荐答案


他们希望Java版本的应用程序能够使用Java中的API

they want a Java version of the app to be able to use the API from Java

Scala类可以从Java中使用(因为它最终都是JVM字节码)。你可以用你的课程包装一个罐子供他们使用吗?

Scala classes are usable from Java (since it's all JVM bytecode in the end). Can you just package a jar with your classes for them to use?

这篇关于自动将Scala代码转换为Java代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆