小编Bil*_*sar的帖子

"未定义的引用:.. ConcurrentHashMap.keySet()"在Java 8中构建时

我有一个项目,我用jdk 6,7,8构建这个项目,我的目标是1.6

当我构建jdk 8时,我收到此错误:

Undefined reference: java.util.concurrent.ConcurrentHashMap.KeySetView java.util.concurrent.ConcurrentHashMap.keySet()

因为我在这行中有这个代码:

   final Iterator<CLASS_NAME> itr = hashMap.keySet().iterator();
Run Code Online (Sandbox Code Playgroud)

如何避免错误,我在互联网上进行了一些搜索,并且由于java 8改变了它的返回类型键集,我得到了错误.这是任何解决方案.我正在使用maven,而animal-sniffer-plugin会出现此错误,并出现签名错误.

java concurrenthashmap java-8

14
推荐指数
2
解决办法
5625
查看次数

Angular 4不包含http请求的标头

我正在尝试非常简单的角度4 http请求.当我检查chrome开发人员工具时,我看不到http标头.

const headers: Headers = new Headers();
headers.append('Content-Type', 'application/json');
headers.append('Authorization', 'Bearer: 123213');
this.http.post('https://127.0.0.1:502', JSON.stringify(token), {headers: headers}).subscribe();
Run Code Online (Sandbox Code Playgroud)

我错过了什么吗?

angular

14
推荐指数
2
解决办法
6万
查看次数

由于缺少执行数据错误而跳过JaCoCo执行

我正进入(状态

由于缺少执行数据文件而跳过JaCoCo执行:/scratch/jenkins/workspace/sonar-test/target/jacoco.exec错误

我的pom档案是:

    <profile>
        <id>test-coverage</id>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven.surefire.plugin.version}</version>
                    <configuration combine.self="override">
                        <redirectTestOutputToFile>true</redirectTestOutputToFile>
                        <testFailureIgnore>true</testFailureIgnore>
                           <groups>com.project.test.annotation.QuickTest</groups>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.7.1.201405082137</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>report</id>
                            <phase>prepare-package</phase>
                            <goals>
                                <goal>report</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

            </plugins>
        </build>
    </profile>
Run Code Online (Sandbox Code Playgroud)

我错过了什么?

code-coverage maven jenkins jacoco

11
推荐指数
3
解决办法
2万
查看次数

qmake 不添加小部件

我有一个简单的程序。我的程序是:

 #include <QApplication>
 #include <QLabel>

 int main(int argc, char *argv[])
{
 int rc ; 
    QApplication app(argc, argv);  
     QLabel *label = new QLabel("Hello Qt!");
    label->show();
     rc = app.exec();
     return(rc) ;
}
Run Code Online (Sandbox Code Playgroud)

我想在命令行中编译和构建此代码。我已经安装了 qt 和 mingw。

首先我的命令是:

  qmake -project
Run Code Online (Sandbox Code Playgroud)

然后我发出这个命令。

  qmake
Run Code Online (Sandbox Code Playgroud)

然后 qmake 创建 .pro 文件,它是:

 TEMPLATE = app
 TARGET = HELLO
 INCLUDEPATH += .

 # Input
 SOURCES += hello.cpp
Run Code Online (Sandbox Code Playgroud)

我认为这个文件必须包含'QT += widgets',但它没有。我不知道为什么。最后,我打电话给mingw make

它给出了错误。

当我添加 .pro 文件 QT += widgets 然后调用 mingw-make 时,它​​会工作并创建 .exe 文件。

那么我的问题是,为什么 qmake 会自动添加 QT += widgets …

c++ qt qmake qt5 qtwidgets

4
推荐指数
1
解决办法
2481
查看次数

标签 统计

angular ×1

c++ ×1

code-coverage ×1

concurrenthashmap ×1

jacoco ×1

java ×1

java-8 ×1

jenkins ×1

maven ×1

qmake ×1

qt ×1

qt5 ×1

qtwidgets ×1