0

Every time I need to delete the previous files to force the compiler not cache

I compile it using:

javac Main.java

and other imported files are nor compiled, until deleted

om-nom-nom
  • 62,329
  • 13
  • 183
  • 228
user2507316
  • 159
  • 4
  • 14
  • 3
    What's being cached that you don't want to be cached? It's not clear what you're asking. – user2357112 Aug 25 '13 at 22:56
  • Perhaps you want to increment the cachesize instead like in http://stackoverflow.com/questions/7513185/what-is-reservedcodecachesize – Jeroen Ingelbrecht Aug 25 '13 at 22:57
  • javac Main.java will never try to compile imported classes – Oleg Mikheev Aug 25 '13 at 22:57
  • @JeroenIngelbrecht are you sure javac and JIT compiler share the same parameters? – Oleg Mikheev Aug 25 '13 at 22:59
  • @JeroenIngelbrecht: javac and the JVM's JIT definitely do not share the same parameters. – Tom Anderson Aug 25 '13 at 23:12
  • k, thanks on that. Pity I can't edit my comment. Deleting it doesn't seem an option. – Jeroen Ingelbrecht Aug 25 '13 at 23:13
  • I mean, I want to fully disable cache, thus every time i write javac, Main.java and other imported files were fully recompiled, as if I were compiling it at the first time, thats what I want is that possible? – user2507316 Aug 25 '13 at 23:21
  • *What* 'compile caching'? What makes you think there even is such a thing? There isn't. If you want to ensure a class is compiled, just delete the .class file first. You can't describe the entire file system as a 'compile cache'. – user207421 Aug 25 '13 at 23:33
  • It should update those implicitly compiled class files when their source files change, so the cache is not a big problem. It only means that *deleted* classes will persist, which you can clean up when you're ready to build a jar. – Boann Aug 25 '13 at 23:53

1 Answers1

1

Of course you don't want ALL imported classes to be deleted (java.lang?) but only your project. Simple: Delete all .class files in your output folder, recursively, with your shell's tools. If you have a dedicated output folder you can just delete the whole folder.

Best method: Learn a build tool like Maven or Ant and use the integrated ways to clean a project output, e.g. with Maven mvn clean. Or if you use an IDE with a built-in builder (e.g. Eclipse) there might be a clean option for the project.

This is not a "cache" in a strict sense.

Hauke Ingmar Schmidt
  • 11,559
  • 1
  • 42
  • 50