将Java内置的应用程序核心更改为Scala-错误和其他疑问 [英] Changing an application core built in Java to Scala - An error and other doubts

查看:58
本文介绍了将Java内置的应用程序核心更改为Scala-错误和其他疑问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

想象一个应用程序的2个模块.一个称为核心,其作用类似于具有一组接口(以及一些已定义的功能)的API.

Imagine 2 modules for an application. One is called core and acts like an API with a set of interfaces (and some functions defined).

另一个模块称为CoreTest,它实现了一些扩展API的类,并且使用JUnit在该内核中进行了测试.

The other module is called CoreTest and implements some classes that extend the API and tests are made in that core using JUnit.

现在,我只想将核心模块更改为Scala.而且我是scala的新手:).

Now I want to change only the core module to Scala. And I am a rooky at scala :).

到目前为止,我遇到了一个错误:

So far I got an error:

由于构建路径不完整,因此未构建项目.不能 查找scala.collection.immutable.List的类文件.修复构建 路径,然后尝试构建此项目ScalaCoreTest

The project was not built since its build path is incomplete. Cannot find the class file for scala.collection.immutable.List. Fix the build path then try building this project ScalaCoreTest

这引起了一些怀疑.

  • 我可以将Scala定义的结构用于Scala吗?
  • 我应该避免在scala中使用其他无法翻译"为Java的东西吗?

我正在使用带有scala插件的eclipse.

I am using eclipse with scala plugin.

推荐答案

检查标准Scala库是否包含在您的项目中.在程序包资源管理器"中右键单击该项目,选择属性","Java构建路径",库".

Check if the standard Scala library is included in your project. Right-click the project in the Package Explorer, choose Properties, Java Build Path, Libraries.

您应该在那里至少看到一个JRE系统库和一个Scala库.

You should see at least a JRE System Library and a Scala Library there.

您的项目可能缺少Scala库.单击右侧的添加库..."按钮添加它,选择"Scala库",然后单击完成".

Your project is probably lacking the Scala Library. Add it by clicking the "Add Library..." button on the right, select "Scala Library", and click Finish.

这篇关于将Java内置的应用程序核心更改为Scala-错误和其他疑问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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