Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Invalid
-
12.0
-
None
-
java --version
openjdk 14.0.2 2020-07-14
OpenJDK Runtime Environment (build 14.0.2+12-46)
OpenJDK 64-Bit Server VM (build 14.0.2+12-46, mixed mode, sharing)NetBeans About Info:
Product Version: Apache NetBeans IDE 12.0
Java: 14.0.2; OpenJDK 64-Bit Server VM 14.0.2+12-46
Runtime: OpenJDK Runtime Environment 14.0.2+12-46
System: Mac OS X version 10.15.6 running on x86_64; UTF-8; en_US (nb)Hardware Information:
Model Name: MacBook Pro
Model Identifier: MacBookPro15,2
Processor Name: Quad-Core Intel Core i7
Processor Speed: 2.8 GHz
Number of Processors: 1
Total Number of Cores: 4
L2 Cache (per Core): 256 KB
L3 Cache: 8 MB
Hyper-Threading Technology: Enabled
Memory: 16 GB
Boot ROM Version: 1037.147.4.0.0 (iBridge: 17.16.16610.0.0,0)
Serial Number (system): C02ZT04JP4G2
Hardware UUID: 9678EC89-6B02-50FB-84B6-CA859359FB50
Activation Lock Status: EnabledSystem Software Overview:
System Version: macOS 10.15.6 (19G2021)
Kernel Version: Darwin 19.6.0
Boot Volume: Macintosh HD
Boot Mode: Normal
Computer Name: --------------
User Name: --------------
Secure Virtual Memory: Enabled
System Integrity Protection: Enabled
Time since boot: 24 days 14:53java --version openjdk 14.0.2 2020-07-14 OpenJDK Runtime Environment (build 14.0.2+12-46) OpenJDK 64-Bit Server VM (build 14.0.2+12-46, mixed mode, sharing) NetBeans About Info: Product Version: Apache NetBeans IDE 12.0 Java: 14.0.2; OpenJDK 64-Bit Server VM 14.0.2+12-46 Runtime: OpenJDK Runtime Environment 14.0.2+12-46 System: Mac OS X version 10.15.6 running on x86_64; UTF-8; en_US (nb) Hardware Information: Model Name: MacBook Pro Model Identifier: MacBookPro15,2 Processor Name: Quad-Core Intel Core i7 Processor Speed: 2.8 GHz Number of Processors: 1 Total Number of Cores: 4 L2 Cache (per Core): 256 KB L3 Cache: 8 MB Hyper-Threading Technology: Enabled Memory: 16 GB Boot ROM Version: 1037.147.4.0.0 (iBridge: 17.16.16610.0.0,0) Serial Number (system): C02ZT04JP4G2 Hardware UUID: 9678EC89-6B02-50FB-84B6-CA859359FB50 Activation Lock Status: Enabled System Software Overview: System Version: macOS 10.15.6 (19G2021) Kernel Version: Darwin 19.6.0 Boot Volume: Macintosh HD Boot Mode: Normal Computer Name: -------------- User Name: -------------- Secure Virtual Memory: Enabled System Integrity Protection: Enabled Time since boot: 24 days 14:53
-
Patch, Important
Description
I have a program that runs perfectly fine in both the terminal and in Intellij, but then when the Java code is run inside a NetBeans project, it outputs incorrectly.
(Before I continue the description, I have a video here and the project itself is attached to this report)
The following is the first code that ran into the problem:
System.out.print("\nPlease enter a month and year (e.g. Sep 2020): "); selectedMonth = Month.valueOf(keyboard.next().toUpperCase()); selectedYear = keyboard.nextInt();
In Intellij and the terminal this was the output (which is correct):
Welcome to Keegan Bilodeau's Calendar Application! Please enter a month and year (e.g. Sep 2020): l Error: You did not enter a valid month! Please enter a month and year (e.g. Sep 2020):
This is the output in NetBeans (which is wrong):
Welcome to Keegan Bilodeau's Calendar Application! l Please enter a month and year (e.g. Sep 2020): Error: You did not enter a valid month!
**Something to note is that when the System.out.print() is changed to System.out.println(), the code runs properly, but with a newline, which is not what I wanted nor should be necessary. One might assume that it was because System.out.println() flushes the stream; however, Using System.out.print() in conjunction with System.out.flush() changed nothing
For even more information regarding the issue, see the attached files.