Tag: 日食

Eclipse计算代码行数

我已经尝试了度量插件 ,尽管它很好,但这不是我的老板正在寻找的东西。 它只用一条线作为一条线,他不希望把它算作“它不是一条线,它是一种风格选择”。 我还需要生成一些关于所提供指标的报告。 有没有什么好的工具?

MapDB ClassNotFoundException:kotlin.jvm.internal.Intrinsics

我想运行一个简单的mapdb例子,但得到的错误: Exception in thread "main" java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics at org.mapdb.DBMaker.fileDB(DBMaker.kt) at leechies.Truc.main(Truc.java:9) Caused by: java.lang.ClassNotFoundException: kotlin.jvm.internal.Intrinsics at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) … 2 more 我的课: package leechies; import java.util.concurrent.ConcurrentMap; import org.mapdb.DB; import org.mapdb.DBMaker; public class Truc { public static void main(String[] args) { DB db = DBMaker.fileDB("file.db").make(); ConcurrentMap map = db.hashMap("map").createOrOpen(); map.put("something", "here"); […]

如何在eclipse maven web项目中编译kotlin

我用了 日食火星 jdk8 tomcat8 kotlin 1.0 即时处理java-> kotlin在春天项目 我在pom.xml中添加这个代码 <properties> <kotlin.version>1.0.0</kotlin.version> </properties> … <dependencies> <dependency> <groupId>org.jetbrains.kotlin</groupId> <artifactId>kotlin-stdlib</artifactId> <version>${kotlin.version}</version> </dependency> </dependencies> …. <build> <plugins> <plugin> <artifactId>maven-eclipse-plugin</artifactId> <version>2.9</version> <configuration> <additionalProjectnatures> <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature> </additionalProjectnatures> <additionalBuildcommands> <buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand> </additionalBuildcommands> <downloadSources>true</downloadSources> <downloadJavadocs>true</downloadJavadocs> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.5.1</version> <configuration> <source>1.6</source> <target>1.6</target> <compilerArgument>-Xlint:all</compilerArgument> <showWarnings>true</showWarnings> <showDeprecation>true</showDeprecation> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.2.1</version> <configuration> <mainClass>org.test.int1.Main</mainClass> […]

Kotlin – Maven不执行测试

所以我有一个我想测试的Kotlin应用程序。 我的测试( .kt )文件,在Eclipse中成功执行。 (测试本身是一个h2 mock jdbc测试)。 现在当运行mvn test -X它说: releases: [enabled => true, update => never] ] [DEBUG] (s) reportFormat = brief [DEBUG] (s) reportsDirectory = C:\Users\Ivar\workspace\anotherworkspace\newrestservice\complete\target\surefire-reports [DEBUG] (f) rerunFailingTestsCount = 0 [DEBUG] (f) reuseForks = true [DEBUG] (s) runOrder = filesystem [DEBUG] (f) shutdown = testset [DEBUG] (s) skip = false [DEBUG] (f) […]

与日食弹簧kotlin

我已经试过春季启动springtest,Kotlin日食简单的网络。 对于Java类,它可以进行热部署。 但不适用于Kotlin文件。 pom.xml几乎完全来自http://start.spring.io/,除了添加springloaded。 <build> <sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory> <testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>springloaded</artifactId> <version>1.2.6.RELEASE</version> </dependency> </dependencies> </plugin> </plugins> </build>

在eclipse上通过gradle设置Kotlin

努力让Kotlin在日食上运行。 我开始了新的渐进式项目。 增加了kotlin网站上规定的依赖关系。 构建通过没有错误。 我在src / java / main下创建了'main.kt'文件: fun main(args: Array<String>) { println("foo") } 但是,我有两个问题:1.任何从kotlin例如println突出显示为“未解决的参考”。 2.我无法运行程序 – Error: Could not find or load main class MainKt (右键单击main.kr作为“kotlin应用程序”运行) 如果我创建“新kotlin项目”,一切正常。 我的分级生成脚本: plugins { id "org.jetbrains.kotlin.jvm" version "1.1.2-2" } repositories { jcenter() mavenCentral() } dependencies { //api 'org.apache.commons:commons-math3:3.6.1' implementation 'com.google.guava:guava:21.0' testImplementation 'junit:junit:4.12' compile "org.jetbrains.kotlin:kotlin-stdlib:1.1.2-2" compile "org.jetbrains.kotlin:kotlin-stdlib-jre8" compile […]

无法在Eclipse中运行Kotlin应用程序

为了在Eclipse中创建我的第一个简单的Kotlin项目,我遵循Kotlin官方网站的Eclipse Luna入门教程中的步骤,即: 从Eclipse Marketplace安装Eclipse的Kotlin Plugin 打开Kotlin的观点,并创建一个Kotlin项目 使用main方法在“src”文件夹内创建文件“hello.kt” 用鼠标右键单击文件>运行方式> Kotlin应用程序 但是,我不断在Eclipse控制台中得到以下错误: 错误:无法找到或加载主类HelloKt 我已经仔细检查了我的项目的运行配置,它确实设置“主类”为HelloKt (我100%确定它不存在)。 另外,当我点击“搜索”按钮时,Eclipse发现的唯一项目是HelloKt – (default package) (这又不存在)。 为了完整起见,下面找到hello.kt文件的代码: fun main(args: Array<String>) { println("Hello, World") } 我注意到了教程和我所做的之间的差异: 我正在使用不同的Eclipse版本(本教程建议Luna;我使用Mars.2)。 我正在使用不同的JDK版本(教程不建议任何特定的版本,但从图像,我们可以看到他们已经使用jdk1.6.0_45 ,而我使用jdk1.7.0_79 。 请注意,我正在使用Kotlin Eclipse插件的最新版本,所以这不是在这篇文章中的情况 。 这些是我当前安装的版本: Kotlin 0.7.2.v20160930-0748 kotlin-eclipse-policy 0.7.2.v20160928-1525 kotlin-weaving-feature 0.7.2.v20160928-1525 运行应用程序时,这些差异中的任何一个都可能是错误的原因吗? 您是否看到/了解有关此情况的任何潜在原因或已知错误? 更新(2017年5月14日) 试用Eclipse Neon.3(eclipse.buildId = 4.6.3.M20170301-0400),JDK 1.8.0_111,Kotlin 0.8.2.v20170314-0957(kotlin-eclipse-policy 0.8.2.v20170314-0957,kotlin-weaving – 特征0.8.2.v20170314-0957,Equinox Weaving SDK […]