unable to locate Java runtime that supports javac on MacOS Monterey

when I run javac -version in the terminal I just get this error:

The operation couldn’t be completed. Unable to locate a Java Runtime that supports javac.

can anyone help fix this I am trying to make a mod for Minecraft with mcp918

MacOS version: Monterey 12.1

πŸ‘︎ 3
πŸ’¬︎
πŸ“…︎ Dec 29 2021
🚨︎ report
ecj fixed in Eclipse upstream years ago, but still impossible to use it in Termux to compile Java 8 (compliance 1.8,) and javac always crashes with "Pointer tag for 0x... was truncated," please how do I get 1.8 compliance in Termux? stackoverflow.com/questio…
πŸ‘︎ 7
πŸ’¬︎
πŸ“…︎ Nov 20 2021
🚨︎ report
I pity the student who only knows how to hit the compile button in the IDE and not `javac`. That's a terrible thing to inflict on a beginner, everything will seem like a mystical black box to them with no way forward when they hit encounter their first compilation problem. news.ycombinator.com/item…
πŸ‘︎ 42
πŸ’¬︎
πŸ“…︎ Nov 07 2021
🚨︎ report
πŸ‘︎ 86
πŸ’¬︎
πŸ‘€︎ u/daviddel
πŸ“…︎ Sep 20 2021
🚨︎ report
JDK 18 - Augmented `javac -xlint:serial` checks inside.java/2021/10/20/au…
πŸ‘︎ 39
πŸ’¬︎
πŸ‘€︎ u/daviddel
πŸ“…︎ Oct 21 2021
🚨︎ report
Javac Symbol not Found HttpServlet

I'm trying to compile a basic Servlet but receive the error "Cannot find symbol HttpServlet".

In TestServlet.java I'm importing the following.

 import java.io.*; import javax.servlet.*; import javax.servlet.http.*;

I try to compile with javac -cp .;[Tomcat-Dir]\lib\servlet-api.jar package\TestServlet.java

I have tried to set the Classpath with Windows environment variables as well, with the same outcome.

πŸ‘︎ 6
πŸ’¬︎
πŸ‘€︎ u/1y2x3c4
πŸ“…︎ Apr 17 2021
🚨︎ report
Install javac command

I already installed several jdks, like jdk-openjdk, jdk...But no matter which one I chose, i could not use the javac command.How do I install javac on my archlinux machine?

For some reason it now works, I did nothing on purpose, idk what was the fix, but I can confirm now that jdk-openjdk works also for me :P

πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/matthis-k
πŸ“…︎ Jun 19 2021
🚨︎ report
Does anyone know anything about Smart Javac (sjavac)?

I know you can invoke it using java -m jdk.compiler/com.sun.tools.sjavac.Main, but where I can find more information about it. Looks like it should support incremental compilation and it split between client and server.

Is it possible to use it in a Maven build?

http://openjdk.java.net/jeps/199

πŸ‘︎ 9
πŸ’¬︎
πŸ‘€︎ u/Thihup
πŸ“…︎ Mar 03 2021
🚨︎ report
Why is javac not compiling my .java file

I am using visual studio code to see the .class file form in front of my eyes. Here is the code I wrote

public class rish { public static void main (String []args){ System.out.println("hello world"); } }

Then I wrote the command javac rish.java In the command terminal Instead of creating a rish.class file It did nothing and when I tried to run it using the command java rish.java The command prompt said : no class declared in source file.

Please help and tell me what is happening? Is there a .class file being created And if yes then where could it be??

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/Diamond_Hoe69420
πŸ“…︎ Apr 11 2021
🚨︎ report
(Java) How do I pass javac/java arguments when running?

I need to pass two javac args on each run: "--module-path ./lib" and "--add-module=javafx.controls". Is there a way to do this?

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/-Pungbaek-
πŸ“…︎ May 03 2021
🚨︎ report
JAVAC Edge Tube Straighteners - Does what it says on the packet! (4 different sizes available: 1/4", 3/8", 1/2", 5/8") v.redd.it/v5fiovfuub651
πŸ‘︎ 266
πŸ’¬︎
πŸ“…︎ Jun 21 2020
🚨︎ report
"javac is not recognized as an internal or external command". I have this error each time I try to compile from my PC, I have set the paths but I still get the same error. Anything else I should try?
πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/TsonK
πŸ“…︎ Apr 12 2020
🚨︎ report
'javac' is not recognized as an internal or external command, operable program or batch file.

I'm new in Java and trying to run my first program but this error keeps popping up. I have added both JRE and JDK in path but i still cant run code. I'm using VSCode as my text editor.

πŸ‘︎ 11
πŸ’¬︎
πŸ‘€︎ u/jkarat6510
πŸ“…︎ Dec 18 2019
🚨︎ report
Ubuntu javac

Hello there!

I recently started my Computer Science studies and our Prof recommended us to use Linux for programming.

After installing Ubuntu on my Laptop i tried to start by writing a small HelloWorld program on the Terminal via nano. Done with that, i tried to compile it via javac but just got some errors like: theres no JDK installied and got some suggested commands to install it, after that I tried to compile it again but just got this error message:

/usr/bin/javac: 4: .: Can't open /usr/lib/java-wrappers/java-wrappers.sh

Now i'm getting a little frustrated, as I'm searching the for about an hour now to find any solution.

If anyone out there is able to help me, it would really brighten up the rest of my day.

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/ChancePut4140
πŸ“…︎ Nov 13 2020
🚨︎ report
javac does not like "Vector< MyClass >.class"

I'm trying to pass that into the constructor of one of my attributes:

private AClass aClass = new AClass( Vector&lt;MyClass&gt;.class );

Another way I can think of doing this is instantiating a empty vector and calling .getClass() on it, but that seems wasteful. Is there another way to do what I'm trying to do here?

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/dog_superiority
πŸ“…︎ Oct 19 2020
🚨︎ report
javac is not recompiling some .java files after a change

I'm building a simple java gui applications using AWT and Swing. Lets say I'm using java 13 and all the files are in a single folder and I'm compiling from the current directory with the command javac *.java or javac Driver.java

My problem is that after modifying and saving some of the .java files related to GUI elements the java compiler (javac) does not recompile those files and I'm forced to delete the .class files first and then compile to see the changes.

Unfortunately, running with just java Driver.java does not work because there are multiple files in the project.

I've tried writing a script to delete *.class files and then compile but that doesn't explain why javac does not detect the changes in the .java files related to a GUI.

Am I missing a concept? Thanks.

πŸ‘︎ 9
πŸ’¬︎
πŸ“…︎ Jan 26 2020
🚨︎ report
Why can't I find nb-javac?

https://cwiki.apache.org/confluence/display/NETBEANS/Overview&#37;3A+NetBeans+Structure

https://preview.redd.it/pfqiqif81in51.png?width=952&format=png&auto=webp&s=edf3f7744426f247be01d7e73ad68720567159b0

Sorry for the noob question.

I installed nb-javac when it was prompted.

I went to Apache's website where nb-javac is in the Netbeans installation folder, saying it's in java/modules/ext. I went to that folder, but it's not there?

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/StevenJac
πŸ“…︎ Sep 16 2020
🚨︎ report
Does anyone actually use javac directly? Should I always be using all Gradle / Maven?

Hey all,

I'm currently shifting gears towards Java from some more dynamic languages. Until now, the main hesitation I've had with Java has been due to feeling overwhelmed at the depth of additional tooling commonly used with Java. Typically as I learn, I like to start as simple as possible and expand tooling as needed with the complexity it adds.

With Java though, I can't quite grasp if this is worth doing. I understand the basics of Java compiling using javac, but is this actually worth learning at all? It seems as though tools like Gradle and Maven seem to be the way to go. Is this true even for more basic projects?

Half of what I like to do with different languages are just very small exploratory projects or programs, where I'm just trying out a new library, but I have yet to find the developmental sweet spot with this with Java.

Any pointers?

πŸ‘︎ 2
πŸ’¬︎
πŸ“…︎ Jul 14 2020
🚨︎ report
Jabel - use Javac 12+ syntax when targeting Java 8 github.com/bsideup/jabel
πŸ‘︎ 117
πŸ’¬︎
πŸ‘€︎ u/speakjava
πŸ“…︎ Sep 01 2019
🚨︎ report
[Beginner] Javac not recognized as internal or external...

So today is my first day with Java, and I am already confused and frustrated. I downloaded JDK and am using intelliJ. I wrote a simple program that prints a few words, which I literally copied from a powerpoint. I found where that .java file is, went into command prompt, and changed the directory to to where it is. I then tried javac and the file name and it gave me the title error. I'm sure many of you have seen or come across this, but I need your help.

I looked up solutions. I changed the system environment Variables Path, something I know very little about. I added the path to the bin folder, which I know is JDK. I'm still getting the error message. I've closed cmd, and tried several times. I've double checked the path, and it's in there. I'm really not sure what I'm doing wrong, and why this is so hard to even run the simplest program. Your help is greatly appreciated.

πŸ‘︎ 17
πŸ’¬︎
πŸ‘€︎ u/Jantonsoup
πŸ“…︎ Jan 12 2020
🚨︎ report
javac.exe could not be found.
πŸ‘︎ 108
πŸ’¬︎
πŸ‘€︎ u/Mattimeo13566
πŸ“…︎ Apr 11 2019
🚨︎ report
Help Javac and Java versions are different.

Im really new to java and ive been just trying to compile and run a small program in the windows 10 cmd prompt. I cant run the java after I complile because my versions are different, how would i fix this?

C:\>cd head first

C:\head first>javac bruh.java

C:\head first>java bruh

Error: A JNI error has occurred, please check your installation and try again

Exception in thread "main" java.lang.UnsupportedClassVersionError: bruh has been compiled by a more recent version of the Java Runtime (class file version 58.0), this version of the Java Runtime only recognizes class file versions up to 52.0

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.access$100(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)

C:\head first>java -version

java version "1.8.0_241"

Java(TM) SE Runtime Environment (build 1.8.0_241-b07)

Java HotSpot(TM) 64-Bit Server VM (build 25.241-b07, mixed mode)

C:\head first>javac -version

javac 14.0.2

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/ChocoDog67
πŸ“…︎ Jul 25 2020
🚨︎ report
Skipping javac

I haven't really used the command line java and javac in a while since I use Ant or some other build tool. When did they make it so you could run the following:

java MyApp.java 

Instead of having to do

javac MyApp.java java MyApp 

I just updated from JDK11 to 14, but I guess this also worked in JDK11, just never tried it I guess.

πŸ‘︎ 16
πŸ’¬︎
πŸ‘€︎ u/SexyBlueTiger
πŸ“…︎ Aug 21 2020
🚨︎ report
Suppress ANSI codes in "javac" output

I was directed here by a r/java bot.

I installed the following JDK on Windows 10:

C:\Program Files\AdoptOpenJDK\jdk-11.0.8.10-openj9

I am new to Java, so lots of error messages, which I like to peruse with my favoured power editor.

If I invoke javac from the DOS CMD shell and redirect stderr to a file, all is fine:

javac -classpath "c:\Program\ Files\...\cplex.jar" TestSetup.java 2&gt; mk.out 

If I use Cygwin Bash to invoke it and redirect stderr to a file, it includes many ANSI codes. Among other things, it colorizes some text:

env -u TERM -u XTERM_SHELL -u XTERM_VERSION -u XTERM_LOCALE \
script -c \
   "javac \
      -classpath \
         '/c/Program Files/.../cplex.jar' \
      TestSetup.java" \
   mk.out

I can clean up the output using the Vim's command :term cat %, but I would prefer a less round-about solution:

  1. How does javac decide not to output ANSI codes in one case but not another?
  2. If it is environment variables, which one? I unset the most obvious ones above, but they don't seem to have any effect.

Other contextual details

For the Bash invocation above, I used script because the most obvious way of redirecting stderr sends output to the console and yields a 0-byte output file:

env -u TERM -u XTERM_SHELL -u XTERM_VERSION -u XTERM_LOCALE \
javac \
   -classpath \
      '/c/Program Files/.../cplex.jar' \
   TestSetup.java \
2&gt;&amp;1 &gt;| mk.out
πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/Ok_Eye_1812
πŸ“…︎ Sep 07 2020
🚨︎ report
I have my Java path set correctly yet I still get 'javac' is not recognized...

I have my Java path set up perfectly, I did a clean installation, I checked inside the bin folder and I have javac etc. and I can use javac from there but command prompt doesn't recognize it. Any help?

πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/Raventhous
πŸ“…︎ Oct 03 2019
🚨︎ report
How to tell javac where a package i need to import is?

Basically I'm trying to import a package that is in a different directory, resulting in a java error: package does not exist. The package I'm trying to import is in \dir1\dir2 and the class I'm trying to import it in is in \dir1\dir3.

πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/muovilusikka
πŸ“…︎ Apr 18 2020
🚨︎ report
Javac and Class files

Wanted to start Java yesterday, tried a simple hello world program but javac outputs 1 error. I saw on a video ( using the Atom editor just like me ) in which the program was compiled using javac, and it automatically generated a class file.. not in my case. I don't know what I'm doing wrong and can't start a simple hello world.. any suggestions

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/ghost_wizard
πŸ“…︎ Jan 23 2020
🚨︎ report
Native javac with GraalVM medium.com/@john_freeman/…
πŸ‘︎ 45
πŸ’¬︎
πŸ‘€︎ u/pron98
πŸ“…︎ Apr 29 2019
🚨︎ report
Is it possible to eliminate javac compilation completely for a 100% Kotlin app?

Even with 100% Kotlin source code, will some of the generated files (Navigation, ViewBinding, R class, etc) prevent compilation to be purely kotlinc?

πŸ‘︎ 6
πŸ’¬︎
πŸ‘€︎ u/nikhilpanju
πŸ“…︎ Mar 05 2020
🚨︎ report
Beware of the -source and -target javac parameters saker.build/blog/javac_so…
πŸ‘︎ 27
πŸ’¬︎
πŸ‘€︎ u/Sipkab
πŸ“…︎ Feb 27 2020
🚨︎ report
Native javac with GraalVM medium.com/@john_freeman/…
πŸ‘︎ 10
πŸ’¬︎
πŸ‘€︎ u/javinpaul
πŸ“…︎ Apr 30 2019
🚨︎ report
New to Java, javac on class files

Pretty new to Java.

Say, you run javac first.java and it makes first.class. You can run this .class file with java first.

What if you run javac first.class, can you run what it makes / produces with the java command?

πŸ‘︎ 10
πŸ’¬︎
πŸ‘€︎ u/Dairy-Coq
πŸ“…︎ Aug 14 2019
🚨︎ report

Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.