Closed impl1874 closed 4 years ago
1、OS and OS versions? 2、Can you see the enable / disable icon at the top-right of the console? 3、Can you see "Ansi Console" in Preferences? Does that panel seem to work? 4、If you go to About Eclipse and click "Installation details" can you see it in the "Installed Software" tab? What version?
eclipse configuration:no Features *** Date: 2020年8月5日星期三 中国标准时间 下午3:47:57
*** Platform Details:
*** System properties:
applicationXMI=org.eclipse.ui.workbench/LegacyIDE.e4xmi
awt.toolkit=sun.lwawt.macosx.LWCToolkit
ds.delayed.keepInstances=true
ds.delayed.keepInstances.default=true
eclipse.application=org.eclipse.ui.ide.workbench
eclipse.buildId=4.16.0.I20200604-0540
eclipse.commands=-os
macosx
-ws
cocoa
-arch
x86_64
-showsplash
-launcher
/Applications/Eclipse.app/Contents/MacOS/eclipse
-name
Eclipse
--launcher.library
/Applications/Eclipse.app/Contents/MacOS//../Eclipse/plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.1200.v20200508-1552/eclipse_1902.so
-startup
/Applications/Eclipse.app/Contents/MacOS//../Eclipse/plugins/org.eclipse.equinox.launcher_1.5.700.v20200207-2156.jar
--launcher.appendVmargs
-product
org.eclipse.epp.package.java.product
-keyring
/Users/yuzhen/.eclipse_keyring
-vm
/Library/Java/JavaVirtualMachines/jdk-11.0.8.jdk/Contents/Home/bin/../lib/server/libjvm.dylib
eclipse.home.location=file:/Applications/Eclipse.app/Contents/Eclipse/
eclipse.launcher=/Applications/Eclipse.app/Contents/MacOS/eclipse
eclipse.launcher.name=Eclipse
eclipse.p2.data.area=@config.dir/../p2/
eclipse.p2.profile=epp.package.java
eclipse.product=org.eclipse.epp.package.java.product
eclipse.startTime=1596613181796
eclipse.stateSaveDelayInterval=30000
eclipse.vm=/Library/Java/JavaVirtualMachines/jdk-11.0.8.jdk/Contents/Home/bin/../lib/server/libjvm.dylib
eclipse.vmargs=-Dosgi.requiredJavaVersion=1.8
-Dosgi.instance.area.default=@user.home/eclipse-workspace
-XX:+UseG1GC
-XX:+UseStringDeduplication
--add-modules=ALL-SYSTEM
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-Dosgi.requiredJavaVersion=1.8
-Dosgi.dataAreaRequiresExplicitInit=true
-Xms256m
-Xmx2048m
--add-modules=ALL-SYSTEM
-Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-javaagent:/Applications/Eclipse.app/Contents/Eclipse/lombok.jar
-Djava.class.path=/Applications/Eclipse.app/Contents/MacOS//../Eclipse/plugins/org.eclipse.equinox.launcher_1.5.700.v20200207-2156.jar
equinox.init.uuid=true
file.encoding=UTF-8
file.separator=/
gopherProxySet=false
gosh.args=--nointeractive
guice.disable.misplaced.annotation.check=true
java.awt.graphicsenv=sun.awt.CGraphicsEnvironment
java.awt.printerjob=sun.lwawt.macosx.CPrinterJob
java.class.path=/Applications/Eclipse.app/Contents/MacOS//../Eclipse/plugins/org.eclipse.equinox.launcher_1.5.700.v20200207-2156.jar
java.class.version=55.0
java.home=/Library/Java/JavaVirtualMachines/jdk-11.0.8.jdk/Contents/Home
java.io.tmpdir=/var/folders/my/d2rd_mkx20b74spj0vbw8mmm0000gn/T/
java.library.path=/Users/yuzhen/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
java.runtime.name=Java(TM) SE Runtime Environment
java.runtime.version=11.0.8+10-LTS
java.specification.name=Java Platform API Specification
java.specification.vendor=Oracle Corporation
java.specification.version=11
java.vendor=Oracle Corporation
java.vendor.url=https://openjdk.java.net/
java.vendor.url.bug=https://bugreport.java.com/bugreport/
java.vendor.version=18.9
java.version=11.0.8
java.version.date=2020-07-14
java.vm.compressedOopsMode=32-bit
java.vm.info=mixed mode
java.vm.name=Java HotSpot(TM) 64-Bit Server VM
java.vm.specification.name=Java Virtual Machine Specification
java.vm.specification.vendor=Oracle Corporation
java.vm.specification.version=11
java.vm.vendor=Oracle Corporation
java.vm.version=11.0.8+10-LTS
jdk.debug=release
line.separator=
maven.defaultProjectBuilder.disableGlobalModelCache=true
org.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog
org.eclipse.debug.ui.breakpoints.toggleFactoriesUsed=false
org.eclipse.equinox.launcher.splash.location=/Applications/Eclipse.app/Contents/Eclipse/plugins/org.eclipse.platform_4.16.0.v20200604-0540/splash.bmp
org.eclipse.equinox.simpleconfigurator.configUrl=file:org.eclipse.equinox.simpleconfigurator/bundles.info
org.eclipse.m2e.log.dir=/Users/yuzhen/eclipse-workspace/.metadata/.plugins/org.eclipse.m2e.logback.configuration
org.eclipse.swt.internal.carbon.smallFonts=
org.eclipse.swt.internal.deviceZoom=200
org.osgi.framework.executionenvironment=OSGi/Minimum-1.0, OSGi/Minimum-1.1, OSGi/Minimum-1.2, JavaSE/compact1-1.8, JavaSE/compact2-1.8, JavaSE/compact3-1.8, JRE-1.1, J2SE-1.2, J2SE-1.3, J2SE-1.4, J2SE-1.5, JavaSE-1.6, JavaSE-1.7, JavaSE-1.8, JavaSE-9, JavaSE-10, JavaSE-11
org.osgi.framework.language=zh
org.osgi.framework.os.name=MacOSX
org.osgi.framework.os.version=10.15.6
org.osgi.framework.processor=x86-64
org.osgi.framework.storage=/Applications/Eclipse.app/Contents/Eclipse/configuration
org.osgi.framework.system.capabilities=osgi.ee; osgi.ee="OSGi/Minimum"; version:List
*** System environment variables: APP_ICON_83784=../Resources/Eclipse.icns HOME=/Users/yuzhen JAVA_STARTED_ON_FIRST_THREAD_83784=1 LOGNAME=yuzhen PATH=/usr/bin:/bin:/usr/sbin:/sbin SHELL=/bin/zsh SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.eI5g9xEzje/Listeners TMPDIR=/var/folders/my/d2rd_mkx20b74spj0vbw8mmm0000gn/T/ USER=yuzhen XPC_FLAGS=0x0 XPC_SERVICE_NAME=org.eclipse.platform.ide.12044 __CF_USER_TEXT_ENCODING=0x1F5:0x19:0x34
Thank you very much for all the details. I am still a bit puzzled though...
So this works: System.out.println("Hello \u001b[31m red world!");
But this does not: mvn clean install -X
?
How do you run mvn clean install -X
from inside Eclipse?
Anyway...
If the direct print works, and something like mvn (or any other external tool) does not, then the most likely problem is that the tool detects that the output is not a terminal and disables colors.
A lot of tools do that so that escape sequences don't end up in a file (if you do mvn install > somefile.log
then you will see the same thing, the file does not contain any ansi escapes)
I don't know of any way to make the Eclipse console report that it is a tty. So the only way is to force the tool to use colors even for for non-terminal output. How to do that is tool dependent.
You can try this by running (in command line, not Eclipse):
mvn clean install > file.log
cat file.log
The log file does not contain colors.
Then try:
MAVEN_OPTS="-Djansi.passthrough=true"
mvn clean install > file.log
cat file.log
You should now see the maven colors.
I am still trying to figure out how to force that in Eclipse.
And would still help if you tell me how are you running mvn clean install -X
from Eclipse.
Did you create a "Maven build" Run Configuration?
Did you create a "Maven build" Run Configuration? Yes. like this: create a "Maven build" Run Configuration? edit Goals "clean install -X" OR "clean install"
Did some digging (including reading through the sources for maven, jansi, and some of the maven Eclipse plugins :-)
It is not a problem with the plugin, it is the fact that the Eclipse does not report that it is a terminal (tty). Because of that both maven and jansi don't output any color information.
And on top of that the "embedded" maven that comes with Eclipse uses the slf4j SimpleLogger, which does not even know about color at all, tty or not.
Here is a workaround, including some explanations at the end: https://mihai-nita.net/2020/08/23/force-maven-colors-in-eclipse-console/
Thanks. work well.
https://mihai-nita.net/2020/08/23/force-maven-colors-in-eclipse-console/ To force Maven to output color no matter the console type we need to set style.color=always. To force Jansi to output color we need to set -Djansi.passthrough=true.
hi. i found the same problem Coloring doesn't work in 2020-03 in: Ansi Console 1.4.2.202002090224 net.mihai-nita.ansicon.feature.group Mihai Nita
but print code work normal.color normal:
System.out.println("Hello \u001b[31m red world!"); System.out.println("Hello \u001b[31m red world!");
test env and test method:
mvn clean install -X
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) Maven home: /Users/yuzhen/develop_software/maven/apache-maven-3.6.3 Java version: 1.8.0_241, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home/jre Default locale: zh_CN, platform encoding: UTF-8 OS name: "mac os x", version: "10.15.6", arch: "x86_64", family: "mac"
my system:
mac os 10.15.6 (19G73)
myeclipse version:
Eclipse IDE for Java Developers (includes Incubating components) Version: 2020-06 (4.16.0) Build id: 20200615-1200
1、new eclipse workspace. no help 2、reinstall plugin. no help 3、check enable/disable.check Preferences. no help
Please help me.Thanks.