更新升级sdkman、删除.sdkman并重新安装、卸载java包并重新安装后,该问题仍然存在。
me@myMachine myProject $ sdk default java 8.0.252.hs-adpt
Default java version set to 8.0.252.hs-adpt
me@myMachine myProject $ sdk default java
Default java version set to 11.0.7.hs-adpt
Run Code Online (Sandbox Code Playgroud)
sdk current java并java -version反映更改,但在关闭并重新打开终端或打开不同的窗口或应用程序时恢复到 11.0.7。
使用Xcode 8.2.1
一套Swift XCT单元测试在运行时不会在相应的swift文件上突出显示代码覆盖率(带有绿色/红色突出显示和编号)。
code coverage : Gather coverage data了测试方案。~/Library/Developer/Xcode/DerivedData和~/Library/com.apple.dt.Xcode。我知道报表导航器可以显示覆盖率,但是它是独立的。
有问题的错误消息是
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.1.0:shade (default) on project myapp-core: Error creating shaded jar: null: IllegalArgumentException -> [Help 1]
Run Code Online (Sandbox Code Playgroud)
从mvn package该在myapp-core文件夹中。mvn clean和mvn compile做工精细。我的项目结构是
myapp/
myapp-acceptance-tests/
myapp-core/
pom.xml
pom.xml
Run Code Online (Sandbox Code Playgroud)
并且myapp/pom.xml由
<groupId>com.myself.myapp</groupId>
<artifactId>myapp</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<modules>
<module>myapp-core</module>
<module>myapp-acceptance-tests</module>
</modules>
<properties>
<maven.compiler.source>10</maven.compiler.source>
<maven.compiler.target>10</maven.compiler.target>
</properties>
<dependencies>
...
</dependencies>
Run Code Online (Sandbox Code Playgroud)
并且myapp/myapp-core/pom.xml由
<artifactId>myapp-core</artifactId>
<packaging>jar</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>myself.myapp.Main</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>10</source>
<target>10</target> …Run Code Online (Sandbox Code Playgroud) 在git push heroku master我的 spring-maven-java 项目上,Heroku cli 识别出它是一个 Java 项目并尝试构建它。它打印出它正在安装JDK 1.8并且在很多终端输出之后它说[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project myProject: Fatal error compiling: invalid target release: 10.0.2
行家-编译器插件配置源和目标明确地确定的Java 10.0.2采用指定为通过Heroku的文档上可接受的,并且java.runtime.version=10.0.2在这两个application.properties和system.properties
我想我需要让 Heroku 在开始时安装正确的 JDK。如何让 Heroku 获取和使用 Java 10?
请参阅我尝试修改的程度 maven-compiler-plugin:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>10.0.2</source>
<target>10.0.2</target>
<release>10.0.2</release>
</configuration>
<dependencies>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>6.2</version>
</dependency>
</dependencies>
</plugin>
Run Code Online (Sandbox Code Playgroud) 我尝试gcc在终端中运行用 Xcode 编写的多个 HelloWorld 文件。为了简洁起见,这是来自TutorialsPoint的一个示例,位于一个名为 的独立文件中myStandaloneHelloWorld.m:
#import <Foundation/Foundation.h>
@interface SampleClass:NSObject
- (void)sampleMethod;
@end
@implementation SampleClass
- (void)sampleMethod{
NSLog(@"Hello, World! \n");
}
@end
int main()
{
/* my first program in Objective-C */
SampleClass *sampleClass = [[SampleClass alloc]init];
[sampleClass sampleMethod];
return 0;
}
Run Code Online (Sandbox Code Playgroud)
它在 Xcode 中编译,但gcc myStandaloneHelloWorld.m在终端中运行时,会产生以下错误列表:
Undefined symbols for architecture x86_64:
"_NSLog", referenced from:
-[SampleClass sampleMethod] in myStandaloneHelloWorld-0af75e.o
"_OBJC_CLASS_$_NSObject", referenced from:
_OBJC_CLASS_$_SampleClass in myStandaloneHelloWorld-0af75e.o
"_OBJC_METACLASS_$_NSObject", referenced from:
_OBJC_METACLASS_$_SampleClass in myStandaloneHelloWorld-0af75e.o
"___CFConstantStringClassReference", referenced …Run Code Online (Sandbox Code Playgroud)