简体   繁体   English

运行示例项目时无法识别的 VM 选项“UseConcMarkSweepGC”

[英]Unrecognized VM option 'UseConcMarkSweepGC' when running sample project

I have followed the instructions for getting started with codenameone in IntelliJ, yet when I set up my first project, based on the sample app I get this error:我已按照 IntelliJ 中的 codenameone 入门说明进行操作,但是当我根据示例应用程序设置我的第一个项目时,我收到此错误:

"C:\Program Files\Java\jdk-15.0.1\bin\java.exe" -Xms128m -Xmx1014m -XX:ReservedCodeCacheSize=512m -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -XX:CICompilerCount=2 -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -ea -Dsun.io.useCanonCaches=false -Djdk.http.auth.tunneling.disabledSchemes=\"\" -Djdk.attach.allowAttachSelf=true -Djdk.module.illegalAccess.silent=true -Dkotlinx.coroutines.debug=off "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2020.3.1\lib\idea_rt.jar=61544:C:\Program Files\JetBrains\IntelliJ IDEA 2020.3.1\bin" -Dfile.encoding=UTF-8 -classpath "C:\Users\reinp\OneDrive - beuthhs\beuth\Patterns und Frameworks\justtrivia\out\production\justtrivia;C:\Users\reinp\OneDrive - beuthhs\beuth\Patterns und Frameworks\justtrivia\src;C:\Users\reinp\OneDrive - beuthhs\beuth\Patterns und Frameworks\justtrivia\lib\CodenameOne.jar;C:\Users\reinp\OneDrive - beuthhs\beuth\Patterns und Frameworks\justtrivia\JavaSE.jar;native\internal_tmp;lib\impl\cls" com.codename1.impl.javase.Simulator com.patrickreinbold.justtrivia.JustTrivia
Unrecognized VM option 'UseConcMarkSweepGC'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Process finished with exit code 1

I saw that this has to do with Java 8 but in the IntelliJ instructions it says nothing about using Java 8. Is Java 8 always necessary or can codenameone run with Java 15, too? I saw that this has to do with Java 8 but in the IntelliJ instructions it says nothing about using Java 8. Is Java 8 always necessary or can codenameone run with Java 15, too?

EDIT: I have now got it to open by simply copying the first line with the java command and removing the UseConcMarkSweepGC flag, then running it in terminal.编辑:我现在只需使用 java 命令复制第一行并删除 UseConcMarkSweepGC 标志,然后在终端中运行它就可以打开它。 But I am still not sure if that is "the correct way" to do it or if something could break along the way now.但是我仍然不确定这是否是“正确的方法”,或者现在是否会出现问题。

Try ignore unsupported VM options: -XX:+IgnoreUnrecognizedVMOptions尝试忽略不支持的 VM 选项:-XX:+IgnoreUnrecognizedVMOptions

This is a problem with the netbeans build script but this isn't really relevant as Codename One only supports Java 8 and Java 11 (at this time) so you should use one of those versions at the moment.这是 netbeans 构建脚本的问题,但这并不重要,因为 Codename One 仅支持 Java 8 和 Java 现在应该使用其中一个版本。

run export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)运行export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)

Homebrew users:自制用户:

Comment out these lines注释掉这些行

# /usr/local/etc/elasticsearch/jvm.options

## GC configuration
#-XX:+UseConcMarkSweepGC
#-XX:CMSInitiatingOccupancyFraction=75
#-XX:+UseCMSInitiatingOccupancyOnly

Then if you get那么如果你得到

Invalid -Xlog option '-Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m'

Update the logging file path更新日志文件路径

# JDK 9+ GC logging
9-:-Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m

to

# JDK 9+ GC logging
9-:-Xlog:gc*,gc+age=trace,safepoint:file=/usr/local/var/log/elasticsearch/gc.log:utctime,pid,tags:filecount=32,filesize=64m

Sources来源

Brew installed Elasticsearch 7.9.2 failing on macOS Brew 安装 Elasticsearch 7.9.2 在 macOS 上失败

https://stackoverflow.com/a/57993824/2237510 https://stackoverflow.com/a/57993824/2237510

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM