Problems compiling and running Java in Notepad++ - java

I recently downloaded a portable edition of Notepad++ and copied Java files in order to be able to use it for java development on the go. I got the plugins I needed, but can't get the code to compile or run. This is the code I have for the script to run and compile the java code:
cd "$(CURRENT_DIRECTORY)"
"F:\Java\jdk1.7.0_11\bin\javac.exe" $(FILE_NAME)
"F:\Java\jdk1.7.0_11\bin\java.exe" $(NAME_PART)
I'm getting an error that says
CreateProcess() failed with error code 2: The system cannot find the
file specified.
I've tried multiple solutions and tinkered with the code to try and solve it, but nothing has worked. What am I doing wrong?

Related

problem installing and compling in JavaFX

I am trying to install JavaFX and in particular just run this application. I've been using Java for a while and I have to compile from console since IntelliJ just won't load in my laptop. Whenever I try compiling with "javac HelloFX.java" I get a lot of errors and in particular error: package javafx.application does not exist. This is what my java folder looks like
Java Folder
I also already set up a path C:\Program Files\Java\javafx-sdk-18.0.1\lib
I really have no clue as to what I am doing wrong, and the solutions I've been able to find seem rather complex, or use IntelliJ tools. Thank you in advance.
Even if IntelliJ does not work for you, you could still use either Maven or Gradle to build your project which would already simplify things a lot. You should also have a look at the official documentation.
https://openjfx.io/openjfx-docs/

How can I set the path to my Java decompiler in VSCode

I am relatively new to stack overflow, VSCode, and programming. I am using a Mac. I downloaded VSCode for use with Python around two months ago. I can not run my code in VSCode but I enjoyed working in VSCode so I would write in it and run my code outside of it. Now I have the same issue with Java. I can not "solve," this in the same way because I do not know how I can run my Java code outside of an IDE.
I first read the instructions for setting up VSCode for Java on VSCodes website. I followed the instructions but when I tried to run a, "Hello world," program it said I did not have a debugger. I re-installed Redhat's Java support, closed and re-opened VSCode, and tried to run it again. This time it said java.jdt.Is.home is pointing to a missing or inaccessible folder. I looked this up found one description of this issue from 2018. I had a hard time understanding what it was asking me to do but at my best interpretation I wrote "which java," in Terminal and copy pasted what it returned (usr/bin/java) into settings.json after "java.home: ". This gave me an error stating that it is outdated and I should change it to, "java.jdt.Is.home: " so I did. I also tried adding "local/" between "usr/" and "bin" as it appeared in my path to my Python3 interpreter. All of these gave me the same error when I tried to run a hello world program.What can I do to solve my issue with Java in VSCode?
which java can not get the right java home.
You need to take /usr/libexec/java_home or /usr/libexec/java_home -V.
Java home on MacOs looks like: /Library/Java/JavaVirtualMachines/jdk-16.jdk/Contents/Home
But You need not set the "java.jdt.ls.java.home" at all. Because the JRE has been embedded in the Language Support for Java(TM) by Red Hat extension.
Only the universal version without embedded JRE can specify the java.jdt.ls.java.home manually. Otherwise, it will search JDK_HOME JAVA_HOME current system path.
You can refer to the official dosc.
So, have you installed the related extensions? You can install Extension Pack for Java, which contains the extensions you need.
I am a little confused about why you can not run the python or java codes, it's very rare. After you installed the related extensions(Python Extension Pack) , just right-click in the editor, you can select the Run Java Debug Java Run Python File in Terminal and so on. Or you can click the button on the top-right.

Eclipse projects stopped working out of nowhere

I was just looking at my java project in eclipse, compiled it, and after closing program all projects in my solution show billions of errors.
Example:
The import java.awt cannot be resolved
When i try to compile it show error:
A JNI error has occured, please check your installation and try again.
Any clues how to fix it? I had many problems with java in the past and i couldn't fin any fixes, almost like it was designed to fail. This language vexes me, but sometimes you just have to use it.
Edit
I also get this error while attempting to open it in IntelliJ (just downloaded it):
JDK jre.1.8.0_241 is missing
Edit
Its just Java being Java (aka not working, as usual). You have to create new project and just copy everything to it, it will work.

Vs Code java The import cannot be resolved

I recently moved from windows 10 to Ubuntu 16.04, I'm a java developer, when I was on windows I installed Vs Code with the java Extension pack. On windows I never Had problem to make my daily work, but on ubuntu, every java file is marked as error, with the message "The import cannot be resolved", searching a litle bit, i found that you can execute the command java:clean the java language server workspace, but this does not fix the problem. I also remove the tmp files from the workspace located on:
~/.config/Code/User/workspaceStorage
the current Version of Vs code is 1.41.1
the current version of Java Extension Pack is 0.8.1
Any ideas?.
Regards!.
Edit:
all my java files are marked as error
inside of every java file
this is the result of the maven-install
well, after a while of searching, I found that the "maven for java" plugin was trying to download the maven plugin maven-metadata.xml, which wasn't available on my repo. this caused a conflict with the initial build that maven for java was doing. to avoid to update every time I opened vs code, I removed the option "update snapshots"
And the initial build was done.

Javac Ubuntu - Junit packages unable to be found

I'm attempting to learn how to use Junit testing through the terminal and so far, I'm stuck in the post installation process. I'm following this tutorial link as of now and I'm pretty sure I've done all the steps in it but my terminal keeps giving me the warning at the javac command that several packages are missing from org.Junit. Help please?
https://www.tutorialspoint.com/junit/junit_quick_guide.htm

Categories