Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

912
Views
Static initialization block differences between Java 13 and Java 8; with different IDE versions (netbeans 8.2 vs outdated apache netbeans 12)

The only discernable difference between these two programs is the Java version.

The question is: what on earth is going on?

This image is proof that both programs contain exactly the same code, while producing different results.

enter image description here

here is the code:

static int x = 10;

static {
    x = x + 10;
}

public static void main(String[] args) {
    System.out.println(System.getProperty("java.version"));
    System.out.println(new Date(System.currentTimeMillis()));
    System.out.println(x);
}
  • LEFT side is using the old netbeans distribution.

  • RIGHT side is using the apache netbeans IDE.

  • LEFT side is using jdk8 (see image)

  • RIGHT side is using jdk13 (see image)

Based on the comments: jdk13 is EOL ... but some people are unable to reproduce it while using jdk13.

The question is: what's causing this?

  • netbeans distribution?
  • borked jdk
  • ... some setting in the apache IDE?
  • ... the stars being out of alignemnt?
  • etc.
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

ANSWER: Underlying problem determined to exist in IDE's compilation/build/execution routine.

Reinstall and update IDE, adoption of non-EOL JDK.

enter image description here

Also, I did not import existing IDE settings.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!