Skip to main content
Filter by
Sorted by
Tagged with
Advice
0 votes
3 replies
104 views

Note. I hope "why" questions do fall into the "other" category. This compiles. class MyClass { private static final String STRING; static { STRING = "abc&...
Sergey Zolotarev's user avatar
3 votes
1 answer
103 views

I'm curious to know why I get this error when compiling my java file from the terminal. I expect the program to compile into an executable file, yet instead I get errors about my packages not existing....
Lucy's user avatar
  • 83
1 vote
0 answers
75 views

I'm learning Java and experimenting with compiling source files. I understand that Java is case-sensitive, and that the filename must match the public class name exactly — including the case. public ...
Koustubh Sharma's user avatar
2 votes
1 answer
142 views

I have a Maven parent POM that configures the Maven Compiler Plugin like this: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</...
Garret Wilson's user avatar
1 vote
1 answer
157 views

So I got to know that javac compiler is written in Java. And JVM converts the bytecode (compiled Java code) to machine code for execution. Two questions: If javac is written in Java, does compiling ...
KRISHNA VAMSI's user avatar
7 votes
1 answer
341 views

I found this minimal set of code which seems to break any Java version I can find. (Also reproducible in https://www.onlinegdb.com/online_java_compiler with Java 23.0.2+7-58). The example is not meant ...
ruohola's user avatar
  • 24.8k
0 votes
1 answer
201 views

I am new to ktor and am following the ktor tutorial (https://ktor.io/docs/server-create-a-new-project.html) and am unable to build the sample app (5th step of unpacking, https://ktor.io/docs/server-...
user6432201's user avatar
1 vote
1 answer
646 views

I am working on a project expecting Maven to resolve version issues and dependencies but keeps crashing on compile phase. First I had the known "unknown reference" for jdk 24: [JAVAC][com....
Juan Felipe Pérez's user avatar
-2 votes
1 answer
149 views

The compiler compiles the source code into bytecode that is then converted into machine code by the JVM or the JIT compiler. If the JIT compiler converts the bytecode to machine code then there is no ...
Sonny Mad's user avatar
1 vote
0 answers
110 views

I have the following simple POM, with only one .java file in src/main/java: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0&...
Ahmad Shahwan's user avatar
3 votes
1 answer
124 views

Here is the code: import java.util.Random; public class StringConcatCompilerOptimization { private static long compute() { var random = new Random(); var l = random.nextLong(); ...
nickolay's user avatar
  • 3,925
0 votes
0 answers
58 views

I've very recently begun working with Ant as my primary buildtool, and have been enjoying it so much that I really would rather stick with it for a while. The only frustrating issue I've run into is ...
Hitotsume's user avatar
2 votes
0 answers
310 views

I am encountering an issue while trying to run my React Native application on Android using the command: react-native run-android The build fails with the following error: Could not determine the ...
Manan Bhasin's user avatar
1 vote
2 answers
273 views

I'm new to java and currently using open-jdk and javac 21 and Eclipse IDE. I'm trying to import om.sun.tools.javac.util.Pair and getting the error - "The type com.sun.tools.javac.util.Pair is not ...
Suga's user avatar
  • 115
0 votes
0 answers
116 views

I am attempting to compile a program using the following command line: javac -cp .:json-20210307.jar:okhttp-4.11.0.jar:okio-3.5.0.jar:kotlin-stdlib-1.9.0.jar RebootDevice.java I get the following ...
Edward Mendes's user avatar
2 votes
0 answers
137 views

I know applets are no longer formally supported. I have some legacy code that can still run using IE 11/Edge in compatibility mode. I can also run applets in any browser using Webswing. My applets ...
ForceRs's user avatar
  • 131
1 vote
3 answers
485 views

I encountered this problem after updating android studio. None of my apps build in android studio: Launching lib/flavors/main_dev.dart on sdk gphone arm64 in debug mode... Warning: This version only ...
NurLife's user avatar
  • 15
1 vote
1 answer
1k views

I am building a Spring Boot project in IntelliJ, and getting a build error: "com.sun.tools.javac.JCTree$JCImport does not have member field JCTree qualid" I have no references to that class ...
Victor Grazi's user avatar
  • 16.6k
1 vote
0 answers
153 views

The antlr4 version is the latest, at the time of posting, 4.13.2, compiled from source. I am using the java8-grammar provided by the grammars-v4 antlr repo I intend to parse large projects for static ...
GeorgeFkd's user avatar
-1 votes
1 answer
107 views

I am having problems understanding how packages work. Not using any IDE. I have the following folder structure: ~/dropbox/api/data Inside the data folder, there are (only) Producer.java, Consumer.java....
limestreetlab's user avatar
2 votes
0 answers
79 views

Why can the Java compiler not compile this? private ButtonGroup groupButtons(AbstractButton... buttons) { return groupButtons(() -> new ButtonGroup(), buttons); } private <BG extends ...
demavi's user avatar
  • 213
-1 votes
1 answer
76 views

I have the following Java code in a file: package hello_project; public class Hello { public static void main(String[] args) { System.out.println("Hello world"); } } The ...
Farhan Adib's user avatar
-4 votes
1 answer
84 views

Attempting to compile the following code with java-1.21.0-openjdk-amd64 results in these errors .../TransactionProfile.java:[60,22] variable emvData might already have been assigned .../...
caduceus's user avatar
  • 1,874
0 votes
0 answers
56 views

I am making a lib that modifies the AST with an annotation handler for parameter injection (src: http://github.com/PhoenixOrigin/DependencyInjector). Right now, all users are required to include ...
phoenix's user avatar
  • 21
0 votes
1 answer
55 views

I have an issue with the makefile I am doing using java. So: ./bin/fp2/poo/utilidades/TitularInterfaz.class: ./bin/fp2/poo/utilidades/CodigoPostalInterfaz.class \ ...
RODSIN's user avatar
  • 21
1 vote
1 answer
319 views

I want to "recreate" J2ME / CLDC with a recent version of javac (e.g. 11.0.19) and compile a purposely built Java program without any or minimal base classes. Obviously classes like java....
mythbu's user avatar
  • 850
0 votes
0 answers
125 views

I have my java installed and linked. Still when I run another config it shows no openjdk development package found. Although I have java installed and linked using a pre built release pegasus@pegasus:...
NobinPegasus's user avatar
2 votes
1 answer
378 views

I have a maven module with 1000+ Java source files. Some of these have annotations that are processed via processors Dagger and Immutables, each of which generates code. When I have an error in a ...
Graeme Moss's user avatar
  • 8,493
1 vote
2 answers
108 views

Here's a sample method: boolean method(int value, boolean check1, boolean check2) { String code; boolean valueIncorrect = false; boolean otherIncorrect = false; if (value < 0 || ...
Hi Jonk's user avatar
  • 31
3 votes
0 answers
142 views

Recent version of Moshi (1.15.0) is issuing a warning Kapt support in Moshi Kotlin Code Gen is deprecated and will be removed in 2.0. Please migrate to KSP. https://github.com/square/moshi#codegen&...
mar3kk's user avatar
  • 1,956
2 votes
0 answers
109 views

This class doesn't compile (using javac 17 or 21), because the second invocation of set() is allegedly ambiguous, while the first one is OK: import java.util.HashMap; import java.util.List; import ...
Hok's user avatar
  • 866
0 votes
1 answer
921 views

I have created a virtual machine to run some java code in it and have specified the VM to run with java 11 ubuntu@go-v12as34df:~$ java -version openjdk version "11.0.21" 2023-10-17 OpenJDK ...
kiwidiwi's user avatar
1 vote
0 answers
61 views

I have the following Java code: public class App{ public int sum(){ return (1 + 2) + (3 + 4); } } After compiling it using javac App.java and inspecting the bytecode with javap -v App, I ...
Volodya Lombrozo's user avatar
1 vote
2 answers
103 views

I learning java. I want understand how this compilation process is done. Imagining how java compiler would compile is simple when there is one file. It would compile line by line. How about having ...
Amarnath's user avatar
-2 votes
1 answer
84 views

I am trying to execute the simple java application in CMD using javac but the outputs of System.out.println is not coming out. Let me show you my code in my MyFirstProgram java file. public class ...
Byungmin  Han's user avatar
0 votes
1 answer
106 views

i am currently trying to run a java file in the terminal inside the corresponding package, which i created in eclipse (so its not the default package). However, the problem began after i tried to ...
khalifakush's user avatar
0 votes
1 answer
450 views

I'm trying to build a Java project with maven image with Gitlab-runner. There was no issue until yesterday, I encountered the error below saying that "Permission is denied". This is the ...
JINWON KIM's user avatar
3 votes
2 answers
781 views

I compiled this code. (use javac 21.0.1) public static final String MAX = "AAAAA ..."; If I repeat 'A' 65534 times in a literal, the compilation is OK. But if I repeat 'A' 65535 times in a ...
YujiSoftware's user avatar
  • 1,737
0 votes
0 answers
36 views

Using java Lets pretend we are in folder "src". The parent directory contains folders "src", "assets" and "bin". Since I am in the folder "src", how ...
Colton Paul Badock's user avatar
-1 votes
1 answer
518 views

I want to see the list of all jdk versions available in my system. However, when I type in java and javac version to the cmd line, it gives me only jdk 20 version. How can I do an implementation to ...
Gulnara Azizova's user avatar
-3 votes
1 answer
101 views

A mindless query arising from Java's less known data type 'null'. Would somebody be able to clarify whether or not 'null' is a literal reserved by the Java language and thus the disparity between it ...
Jim W. Moch's user avatar
0 votes
0 answers
39 views

Let's look at the following example. public class T1 implements Cloneable { private T1(T1 g) {} public T1 clone() { return new T1(this); } } There are two clone methods in a bytecode. $ ...
Павел's user avatar
0 votes
0 answers
99 views

I want to modify some java classes bytecode during/after compilation phase, but before packaging, in order to use custom invokedynamic bootstrap methods. In order to do so, I have written a Java ...
Mikhas's user avatar
  • 882
0 votes
0 answers
42 views

I am not familiar with gcc,this code: int a=145;int b=267+a; printf("%d/n",b); if comiple with no optimize option,will use the "addl" command,but if open O2 option,it will show me ...
wang kai's user avatar
  • 1,767
0 votes
0 answers
188 views

I am compiling some legacy java code using plain javac. The OS is linux and JDK level is: java version "1.8.0_361" Java(TM) SE Runtime Environment (build 8.0.8.0 - pxa6480sr8-20230314_01(...
zhangt's user avatar
  • 1
2 votes
1 answer
2k views

Is it still necessary on Windows to add the -encoding UTF-8 parameter to the Java Compiler, when using German Umlaut ß in sources? I thought that UTF-8 is the default for Java, isn't it? class Main { ...
Tobias Otto's user avatar
  • 1,686
2 votes
1 answer
162 views

I have a very simple source file -- HelloWorld.java public class HelloWorld { public static void main(String[] args) { System.out.println("hello world"); } } I have the ...
davidalayachew's user avatar
0 votes
1 answer
83 views

can't really find the proper answer. if we have: 1.Animal cat = new Cat(); 2.Animal animal = new Animal(); Animal and Cat both has method makeSound(); 1.as I understand early binding in Java happens ...
Ivs's user avatar
  • 13
0 votes
0 answers
232 views

When I use the java/javac command on cmd as in javac Theory/HelloWorld.java java Theory.HelloWorld it works just fine, yet when I do that on the VSCode terminal it doesn't work at all and says "...
BODDAH's user avatar
  • 1
0 votes
1 answer
50 views

Consider this very simple generic class: class GenericTest<T> { T t; GenericTest(T t) { this.t = t; } } I created multiple objects of this class, one of them is raw type: ...
Mehdi Rahimi's user avatar
  • 2,766

1
2 3 4 5
50