Questions tagged [javac]

javac is the primary Java compiler, included in the Java Development Kit (JDK) from Sun Microsystems (now Oracle), and also in versions from other vendors.

javac is the primary Java compiler, included in the Java Development Kit (JDK) from Sun Microsystems (now Oracle), and also in versions from other vendors.

The compiler accepts source code conforming to the Java language specification (JLS) and produces bytecode conforming to the Java Virtual Machine Specification (JVMS). javac is itself written in Java. The compiler can also be invoked programmatically.

2467 questions
0
votes
0 answers

Possible values for Ant Javac attributes "source", "target", "compiler" across various JDK versions?

For the Ant javac task below, is there a resource that lists the values of source, target, and compiler for various JDK versions?
user10931326
  • 787
  • 2
  • 8
  • 15
0
votes
0 answers

How to configure JavacProcessingEnvironment to print log messages in multi-line mode?

I have an annotation processor from which I want sometimes to log errors. These errors are logged as such: processingEnv.getMessager().printMessage(kind, msg, element) ... where processingEnv is an instance of JavacProcessingEnvironment that is…
Matteo NNZ
  • 11,930
  • 12
  • 52
  • 89
0
votes
0 answers

How to fix Task :app:compileDebugJavaWithJavac FAILED in React Native?

I am trying to build this react native application and when I run npx react-native run-android, I get the following error, please help I tried cd android && ./gradlew clean and that shows build successfull. What do I do? Can someone please help? I…
0
votes
3 answers

Java version does not apply on Mac

I am trying to set my machines javac version to 11 from 18.0.2 and I'm doing the following steps open ~/.zshenv export JAVA_HOME=$(/usr/libexec/java_home -v11) source ~/.zshenv When I check the version, I still get it as 18.0.2. Not sure what I am…
boomchickawawa
  • 508
  • 1
  • 6
  • 25
0
votes
0 answers

error: cannot find symbol while running javac to compile in ubuntu terminal for Long.parseLong("string")

This is a program which demonstrate the working of parseLong When i run this in bluej it gave me output as as given below But when i ran this in console in ubuntu terminal by compiling using the command javac it gave me compilation error as given…
Midhun Raj
  • 925
  • 2
  • 7
  • 21
0
votes
0 answers

How to compile Java 9 and subsequent releases code in JDK8?

I have a maven aggregate project that contains api, application, domain, infrastructure and common-util modules. The aggregate project JDK version is 17, but the common-util module alone uses JDK8 instead of 17 (for more compatibility). All source…
0
votes
1 answer

javac -cp src\x\y\z src]x\y\z\*.java works but javac -cp src\x\y\z src\x\y\z\MainClass.java fails

My java project has 4 modules in directory project\src\x\y\z. A compile with maven or with javac -cp src\x\y\z src\x\y\z\*.java works (i.e. completes with no errors) and the timestamps indicate the class files were recreated, but javac -cp…
MikeL
  • 1
  • 1
0
votes
0 answers

OpenHFT / OSGiaaS Javac - Compiling an Unknown Interface - Package Does Not Exist

I'm developing an OSGI Eclipse plugin application (part of KNIME) and I'm trying to integrate a runtime compiler that can handle an "unknown" interface (that is, not an interface from a java.* library loaded before the system class loader). The two…
0
votes
2 answers

How do you specify the classpath when running the javac command?

I'm trying to import Bar.java into Foo.java, where my directory is structured like this: . └─bar └─Bar.java └─foo └─Foo.java So I create Bar.java: package bar; public class Bar {} and Foo.java: import bar.Bar; public class Foo {} I run javac…
Liam
  • 109
  • 3
  • 11
0
votes
0 answers

How can I check a Java file for errors, without producinv a .class file?

Is there a way to have javac only check a Java file for errors, but without compiling it to a class file? I'm only interested in checking whether the file has syntax errors and so on. I don't want the compiled class file.
hugomg
  • 68,213
  • 24
  • 160
  • 246
0
votes
0 answers

Can you sense javac errors using Powershell?

I am using javac in Powershell right now, but I am having an issue. The message selected file has been succesfully compiled:) I made it show after compilation shows up even if there have been errors during compilation. Here is my current…
PlatoHero
  • 31
  • 5
0
votes
2 answers

Can javac process/include `.properties` files so that they appear in the output?

Currently I'm building a small personal project in Java which is a simple file server. I've implemented basic internationalization with usage of ResourceBundle. I'm using .properties files to store messages in different languages. Till now I was…
USHKA
  • 647
  • 4
  • 18
0
votes
0 answers

Compile a java 1.6 project using external library which was build using Java 1.8

I have a large project which is build using Java 1.6 and I can not update its build path to Java 1.8 because it causes too many compile errors. I have to use an external library (underscore)…
benchpresser
  • 2,171
  • 2
  • 23
  • 41
0
votes
0 answers

Visual Studio 2022: Java related issues when user name contains non ASCII characters in Xamarin Android Development

I've created a new Xamarin Android project on Visual Studio 2022. Code and designer works properly. I wanted to deploy the app to the Android Emulator. First I have problem with "file doesn't exists: xxx.tmp" error and I assumed this is about the…
Ozkan Tuzemen
  • 155
  • 11
1 2 3
99
100