0

I am using Java JDK 20.0.1 on IntelliJ 2023-1.

I am trying to run a Java application.

I get a very generic error about the tzdb.dat file.

The error is:

Executing pre-compile tasks...
Running 'before' tasks
Checking sources
Copying resources... [JavaDesktopSudokuDemo]
Parsing java… [JavaDesktopSudokuDemo]
java: C:\Program Files\Java\jdk-20\lib\tzdb.dat <<<------
Checking dependencies… [JavaDesktopSudokuDemo]
Dependency analysis found 0 affected files
Errors occurred while compiling module 'JavaDesktopSudokuDemo'
javac 20.0.1 was used to compile java sources
Finished, saving caches…
Compilation failed: errors: 1; warnings: 0
Executing post-compile tasks...
Compilation failed: errors: 1; warnings: 0
Synchronizing output directories...
27 Jun 2023 16:38 - Build completed with 1 error and 0 warnings in 1 sec, 173 ms

I tried to update the tzdb.dat file by directly downloading it from Oracle and by using tzupdater.jar. I've tried changing the file name to add .bak at the end, but that creates a file not found error.

  • 1
    That looks like very incomplete information. The error is just vaguely telling you it didn't compile properly. What makes you think it's to do with that tz data? You should probably be giving the result of your build attempt, not an attempt to run it – g00se Jun 27 '23 at 20:17
  • @g00se When I run the application this line is red `java: C:\Program Files\Java\jdk-20\lib\tzdb.dat`. The above is the output it provides when I try running it. – Joey Tatú Jun 27 '23 at 21:59
  • *Compilation failed: errors: 1; warnings: 0* Why would you try to *run* something you are told doesn't compile? You need to make it compile first – g00se Jun 27 '23 at 22:03
  • @g00se There's no difference between Compile and Build in IntelliJ. I don't think I fully understand how I can fix it. Can you advise how I could fix it? Like, what would you do? Thanks. – Joey Tatú Jun 27 '23 at 22:17
  • That might be the case, but there's certainly a difference between build and run. I can't say exactly what I'd do as I don't use IDEA – g00se Jun 27 '23 at 23:17
  • @g00se Thanks, I'm going to try Eclipse and see tomorrow. Thanks for your help. – Joey Tatú Jun 28 '23 at 00:07
  • If you're not an advanced developer I would recommend you don't use *any* IDE. You will learn more quickly about how Java works internally and you won't be forced to learn simultaneously about how to use your IDE. Later on you can add Maven/Gradle. – g00se Jun 28 '23 at 06:37
  • @g00se I actually have a degree in Computing. It's just I haven't used Java in about 7/8 years. That is a very good point though, I might do a refresher course on Java internals. I tried running the application in Eclipse and it works fine. Maybe it's just IntelliJ being weird. – Joey Tatú Jun 28 '23 at 11:16
  • I would particularly recommend getting to grips at the command line with Java modules – g00se Jun 28 '23 at 11:53

0 Answers0