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

How does exec java
work in bash?

I have come across a bash script that appears to be running a java main class without compiling it or producing a binary. Namely I am looking at the final lines of this script: MAIN_CLASS="com.amazon.kinesis.streaming.agent.Agent" exec $JAVACMD…
user313
  • 681
  • 1
  • 8
  • 21
0
votes
0 answers

is there a way to get the output from javac when running maven

Sometimes I run maven and get a compilation error, but there's no way to know what's wrong because maven swallows the output from javac. Is there a way to get it show this output?
Mark VY
  • 1,489
  • 16
  • 31
0
votes
1 answer

Eclipse JNI fails with 'javac: invalid flag: ../bin'

I'm trying to create a JNI project in Eclipse using CDT. I'm following this tutorial. So first I created my project as a Java project and created a HelloJNI class in the default package, which contains some really basic code. I then added a C nature…
new Q Open Wid
  • 2,225
  • 2
  • 18
  • 34
0
votes
1 answer

Java compiler from command Line not including external Jar files

Havnt used java in 3 years or so. Found something I needed to do and thought I had some good old code I could reuse. Got everything working the way I need to but am a little thrown off on how jar imports seem to have changed a bit with the module…
tw123
  • 1
  • 1
0
votes
0 answers

Downgrading java version in project (IntelliJ)

I am trying to downgrade the target build version of java, but somehow I can´t change it within IntelliJ, don´t understeand why. Under File -> Project Structure -> Projects I changed the language level and the SDK (java 11), but somehow javap -v…
WinterMute
  • 145
  • 2
  • 11
0
votes
1 answer

Dynamic code compilation fails when running tests with Sbt

I have a scala test that dynamically generates a java source code and compiles it at runtime. It works perfectly when I run tests in IDE (IntelliJ), but fails when using sbt test. The main difference is when running in IDE my test class, third party…
dmgcodevil
  • 629
  • 1
  • 7
  • 23
0
votes
2 answers

Java 11 include jdk.compiler/com.sun.tools.javac classes into project

I need to work with com.sun.tools.javac classes that are private and are not visible neither during compile nor run time. I use: JDK 11.0.15 Maven build tool Intellij IDEA My current state is that my imports are red-highlghited and compilation…
Serhii Kachan
  • 345
  • 4
  • 13
0
votes
0 answers

why android compiler generate different MethodRef for same code

i happened to encounter some wired compiled bytecode which i believe both sharing the same source code like below class SomeWebView extends WebView { SomeWebView() { this.getSettings(); } } version 1 (above code write in app a)…
Minami
  • 963
  • 6
  • 21
0
votes
1 answer

javac: classpath (ignored?) when -d is supplied

Having some trouble with ant build scripts (the project and code is not written by me, I am trying to do some third party library debugging which requires building this project). I'm trying to see if I can get to the bottom of the ant script errors.…
0
votes
2 answers

Why I am getting package not found error?

I have created two java files A.java and B.java. Both classes are in same folder testjava. Code in A.java package pkg; public class A{ int data; public void printer(){ System.out.println("I'm in A"); } } Code in B.java package…
manusrao
  • 40
  • 7
0
votes
1 answer

Where do I find the javax.servlet classes needed to compile my servlet?

I've been much time on this issue, I need to have javax.servlet.Servlet(also, javax.persistence) available. I downloaded it and put it in all the places I believe make sense(C:\Program Files\Java\jdk1.6.0_20\lib ... C:\Sun\SDK\lib [the Glassfish…
Caffeinated
  • 11,982
  • 40
  • 122
  • 216
0
votes
1 answer

Could not find or load main class in a simple java project

I have created a simple java project "DesignPatterns". I created a file FacadePattern.java with the path being ~/DesignPatterns/Structural/FacadePattern/FacadePattern.java My FacadePattern.java class, public class FacadePattern { public static…
i_know_what
  • 35
  • 2
  • 7
0
votes
1 answer

Can I use * in Process's getRunTime().exec(String[] cmdarray, String[] envp, File dir) ? I keep getting createprocess error=2

Below is the portion that is throwing the error File dir = fcd.getSelectedFile(); // file directory in which to compile all code String[] cmdarray = {"javac *.java"}; try { Process process = Runtime.getRuntime().exec(cmdarray,null,dir); …
0
votes
1 answer

Is there a way to make my android device display the xml layout on the fly?

I am starting to learn android (through the busy coder's guide book) and I prefer using the commandline tools over the IDE and it's going well so far (in chapter 12 now) But I am wondering If i can automate the building process to just display the…
Susano
  • 230
  • 2
  • 9
0
votes
1 answer

How to get from parse tree to Java class file

I am working on a command-line tool with the following functionality: Parse modified .java files using an extended ANTLR4 Java9 grammar. The syntax in the files is Java, with one modification to the method declaration which includes a purpose, like…
Mia
  • 23
  • 3
1 2 3
99
100