"javac: not a file: ..." compilation error? - java

I'm using jGrasp for a school project, and I only recently started getting this error. I already tried troubleshooting on here and on other forums, but with little success. I already created a JAVA_HOME variable and set my path variable to %JAVA_HOME%\bin, but this did not allow me to compile my code. My TA told me to reinstall the jdk, which I did and reset my path to the newest jdk version. This did not help either.
Here is the error message

I would suspect the cause are the blanks in the folders names. You'd better rename the parent folders to strip all the blanks off.

Related

Having trouble setting up Eclipse for android development

I need to set up a workspace in eclipse to edit an APK so that I can mod it. I have the decompiled and deobfed java sources but I have never done this before, and I can't get eclipse working with android. I have installed the sdk and the software for eclipse, but I have some errors after creating a new basic project. Here are some of the many errors, Probably stemming from 1 problem that I just cant figure out.
XML:
Error in an XML file: aborting build.
\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
Among many, many more XML errors that look similair.
Java:
ActionBarActivity cannot be resolved to a type
R cannot be resolved to a variable
The import android.support cannot be resolved
The method getMenuInflater() is undefined for the type MainActivity
There are definitely some jars that should be in the build path that are not there, but I don't know why they aren't there and what is missing. I probably set it up wrong but I tried uninstalling and reinstalling and that did not help.
Sorry for the shitty formatting I have no idea how to format and this is my first question on here sorry!

In NetBeans 12.0 I get the error cannot access java.lang

I know there are very many questions exactly like this, but I have tried various things and still have no idea what to do. I started learning java very recently and was just able to print "hello world" with a .java file using a text editor. That was when I decided to get an IDE and I downloaded NetBeans 12.0. Once netbeans was ready, I clicked "new project" and chose "Java with Maven" and "Java application". Once I finished setting up the project, I right clicked the package and made a new main class. However, next to "package com.mycompany.qwerty" in the file there was a red exclamation mark symbol where it shows the line numbers. When I put my mouse over it, it said "Cannot access java.lang Fatal error: unable to find package in classpath or bootclasspath". I have absolutely no idea how to fix this since I have never used NetBeans before. I have tried reinstalling netbeans several times and the same thing occurs. I have jdk 11.0.8 as well. How would I resolve this issue?
After reading sorifiend's comment, I looked up how to change the file path for jdk. In a file called netbeans.conf the variable called netbeans_jdkhome was just /usr or something and I changed it to /usr/lib/jvm/java-1.11.0-openjdk-amd64 (I have linux) and then the problem was completely fixed.

I'm having a trouble with starting Eclipse : Error : ... cannot be solved to a type

I really don't know what the problem is.
I followed several web postings about installing and settings of JDK/ JRE and also completed clearly on environment variables :Path & CLASS PATH
I'm sure about that since i checked the cmd and it worked well.
the same problem occured over and over again.
I corrected on Library tab
I add the Library list like this,
But, I still have the same problem. Did I make a severe mistake? what should I do about this problem?
still have JAVA problems
Please check the Java source directory configuration under Java Build Path, Source tab and Java Compiler version settings.
Did you recently update your Java version? If so, then you have to readjust your path so that it directs to the new updated version.

Error while running studio.exe in installing Android Studio

I got an error while installing Android Studio and this is the error message:
Internal error. Please report to http://code.google.com/p/android/issues
java.lang.RuntimeException: Could not find installation home path. Please make sure bin/idea.properties is present in the installation directory.
at com.intellij.openapi.application.PathManager.getHomePath(PathManager.java:84)
at com.intellij.openapi.application.PathManager.loadProperties(PathManager.java:315)
at com.intellij.ide.BootstrapClassLoaderUtil.initClassLoader(BootstrapClassLoaderUtil.java:58)
at com.intellij.ide.Bootstrap.main(Bootstrap.java:33)
at com.intellij.idea.Main.main(Main.java:84)
2014-11-15 15:42:10 [Patch] Original patch does not exist: C:\Users\DANIEL~1\AppData\Local\Temp\jetbrains.patch.jar.androidstudio
In the beginning I pointed out there is something wrong with bin/idea.properties file. Maybe method com.intellij.openapi.application.PathManager.getHomePath could not find the IDEA_HOME path in my Windows environment variable. After some analysis I narrowed the error cause to the folder naming. I installed the Intellij IDE to custom folder: C:\!DATA_STORAGE!\PROGRAM_FILES\Intellij.
I tried to rename the folder with special character (exclamation). The results was:
C:\!DATA_STORAGE!\PROGRAM_FILES\Intellij - error
C:\DATA_STORAGE\PROGRAM_FILES\Intellij - OK (IntelliJ started)
C:\!DATA_STORAGE\PROGRAM_FILES\Intellij - OK
C:\DATA_STORAGE!\PROGRAM_FILES\Intellij - error
Finally I found the logic: whatever comes after the ! mark is inside the JAR file.
http://docs.oracle.com/javase/7/docs/api/java/net/JarURLConnection.html
The behaviour has been raised as bug in Java 1.3, 1.4, 5.0.
http://bugs.java.com/view_bug.do?bug_id=4523159
There has been made a little change but overall the problem remains. The best existing solution is the workaround: don't use exclamation mark at the end of folder name or file name.

Android Java compiler error (compiling old files?!)

I refactored some packages in my IDE and everything seems to be ok. But when I compile my app I get an error that file x.java can't be read in x.java.
Both files are located in the old packages which do not exist anymore.
The package definition is fine in all classes. Also the Manifest is fine.
I'm using IntelliJ IDEA from JetBrains.
java: error reading K:\APP\src\com\renemaas\android\APP\About.java; K:\APP\src\com\renemaas\android\APP\About.java (The system can't find this path)
I hope someone can help me with this problem.
Note: Yeah I have search for nearly 1 hour to solve this problem on my own. I'm new to Android development.

Categories