javac isn't working in Desktop and Documents Directory - java

I installed jdk1.8.0_202 and set the path for jdk1.8.0_202/bin, jre1.8.0_202/bin and JAVA_HOME in both 'user variables' and 'system variables'.
I created a test java file on Desktop and opened cmd(non admin) and tried to compile which resulted in the following error.
C:\Users\andey\Desktop>javac Main.java
Main.java:2: error: error while writing Main: Main.class (The system cannot find the file specified)
public class Main {
^
1 error
Same happened with Documents folder and sub folders. I also tried using cmd(elevated) but I got same error.
I could compile successfully on any other folder except those 2 folders(Desktop and Documents) even using non-elevated cmd.
I want my programs to be either on desktop or in documents.
Any help is appreciated.

Related

Getting Error: Could not find or load main class org.apache.axis2.transport.SimpleAxis2Server

I am new to Axis , I am trying to start Axis2 as a Standalone Server using the Standard Binary Distribution package in Linux. I went through this guide: https://axis.apache.org/axis2/java/core/docs/installationguide.html
I have downloaded and unpacked the distribution in it's own directory and i have also set environment variables AXIS2_HOME and JAVA_HOME as follows :
export AXIS2_HOME=/opt/axis2-1.8.2
echo $AXIS2_HOME returns
/opt/axis2-1.8.2
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64/bin
echo $JAVA_HOME returns
/usr/lib/jvm/java-1.8.0-openjdk-amd64/bin
When trying to run axis2server.sh which is essentially the script to start the server I get the following prompts :
user#serverFoo/opt/axis2-1.8.2/bin$ ./axis2server.sh
Using AXIS2_HOME: /opt/axis2-1.8.2
Using JAVA_HOME: /usr/lib/jvm/java-1.8.0-openjdk-amd64/bin
Error: Could not find or load main class org.apache.axis2.transport.SimpleAxis2Server
Coming from a JAVA background I understand that it can't find or load the server class, although I can't find any resources in the web pointing to the specific error .
EDIT : I have also added CLASSPATH variable pointing to the AXIS2_HOME/lib directory i.e
export CLASSPATH=/opt/axis2-1.8.2/lib/*.jar but still the same .
Any ideas would be welcome.
Thanks

Delphi 10.1 Berlin - Java2OP: class or interface expected

I'm using Delphi 10.1 Berlin. I want to call Java codes from Delphi. So, I created JAR file in Android Studio (this link helped to me). Then I opened Java2OP.exe from C:\Program Files (x86)\Embarcadero\Studio\18.0\bin\converters\java2op directory. I moved the jar file to this directory. Then I worked this commands in CMD:
SET PATH=%PATH%;"C:\Program Files\Java\jdk1.8.0_60\bin"
Java2OP.exe -jar ..\libmylib.jar -unit ..\Androidapi.JNI.MyLib
But I get this error:
Warning: error opening ReservedWordsOP.txt
Warning: error opening ReservedWordsC.txt
Parsing xml: C:\Program Files (x86)\Embarcadero\Studio\18.0\bin\converters\java2op\bootclasses.xml
Parsing jar: ..\libmylib.jar
class or Interface expected
This my Java class for JAR:
public class Test
{
public String work()
{
return "Hello World!";
}
}
Also I tried different Java codes, but result is same. How can I solve this problem?
I have the same problem, and solved it removing spaces from path files.
Probably the Java2OP is calling the Java passing the path without quotes.

How to solve could not find or load mainclass error?

I am getting this error if I add new component to my frame if I remove it then it works.
I done this troubleshooting
(1)deleting index folder and restart computer and netbeans
(2)increased heap size in conf file
(3)set environment variable in windows system as
:-User variable name = CLASSPATH
:-variable value = C:\Program Files (x86)\Java\jdk1.8.0_40\bin;C:\Program Files (x86)\Java\jre1.8.0_40\bin;.
:-System variable name :-Path
:-System Variable value:-C:\ProgramData\Oracle\Java\javapath;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Java\jdk1.8.0_40\bin;C:\Program Files (x86)\Java\jre1.8.0_40\bin
but the problem persists
if i add new component(radiobutton,label,scrollpane) it gives me this error:
you can try Clean and build your project, if it doesn't work, you can check the posts from
Netbeans - Error: Could not find or load main class ,
Error: Could not find or load main class (netbeans and java)
or
What does "Could not find or load main class" mean?
With Java 11 you can start a class from the terminal with
java classname.java

Error: Could not find or load main class is seen even after giving the classpath

i am trying to execute a java program from command prompt.
On executing the below command the error - Error: Could not find or load main class is seen. The command includes the path to jar files and also path to out folder where class files are present. The same program is working fine in Intellij though.
[root#abc TagPackage]# java -cp "/home/admin/TagAPI/out/production /TagAPI/TagPackage/*":"/home/admin/TagAPI/lib/*" Test3
Error: Could not find or load main class Test3
The structure of my program is as below :
TagAPI> src> (Package)TagPackage> Test3.java
Any suggestion will be helpful, Thanks!!

cannot find org.neo4j.batchimport

I am continuing to have trouble with the import.bat file for the Neo4j batch importer. I started a new thread as the original problem was resolved.
from the command prompt I run
import.bat test.db sample\nodes.csv sample\rels.csv
With some variations on the path listing for the files, including absolute paths. I continue to get the following error message
The system cannot find the path specified.
Error: Could not find or load main class org.neo4j.batchimport.Importer
I also tried running import.sh from Cygwin and in my Debian VM but keep getting the error
Error: Could not find or load main class org.neo4j.batchimport.Importer
What am I doing wrong?
Please download the zip-file, not the github clone.
This is a pre-build binary as outlined in the readme, that doesn't require that you have to have maven installed to build it.

Categories

Resources