Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 6 years ago.
Improve this question
I've finished my Java assignment on Netbeans, however the files are .class. If I understand correctly this means they have been compiled using javac into bytecode? I'm sorry, I'm new to all of this. However I must submit this is in .java format. If I just rename the file it doesn't open properly, is there proper procedure using Netbeans or something? (I'm on windows 10, Netbeans 8.2).
Sorry if this is a really noobish question and I'm being stupid! It's always the tiny things I get stuck on. Thanks.
You have your source code in *.java files, then they must be compiled to *.class, bytecode. This bytecode you can run on JVM: java "name of file without .class suffix".
If you want to change your *.class file, you must change *.java file, then compile again to *.class.
I hope this will help you.
Related
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
I was trying to access a file with a java scanner class but always got FileNotFoundException so i tried to output what my current working directory was System.out.println(System.getProperty("user.home"));
and it returned null
Do i have to manually set it somewhere in project settings or are my enviromental paths messed up? How can i fix this?
When you are on Android the traditional 'user.home' property has no specific meaning or equivalent to what it would in a traditional desktop java application. However when running inside an Android runtime you should have access to the 'Environment' class which defines a number of paths to relevant directories.
Take a look at the getDataDirectory() call, which should give you a file object to the correct system path.
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
We have the below java command which was running and stopped working all of a sudden,
java –cp "classes:lib/*" xxx.yyy.ppp
The jar is within lib directory and the jar contains the class.
It stopped working all of a sudden and gived the below error,
"Error: Could not find or load main class –cp"
Why is it considering '-cp' as the main class, even though ppp (example) has the main class. Please help me out with this...
You are not using a default hypen before cp as java –cp "classes:lib/*" xxx.yyy.ppp
Use this instead : java -cp "classes:lib/*" xxx.yyy.ppp
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 years ago.
Improve this question
I am trying to install Java 7u80 on Windows 10. When I attempt to install it, get this error:
"Error 1324. The path Temp;C: contains an invalid character."
I am not sure what it means or why it is even trying to use a path with those characters in it. I have been trying to do research on this issue and so far found nothing. The solutions I found said that it is caused by a username with an invalid character in it, but my username is CF77. I do not know what to do and am looking for help.
Your TEMP or TMP environment variable is likely bad. That's usually where installation programs find the path to the temp folder. Type command set in a command prompt to see your environment variables. – Andreas
Well you can easily figure out if you watch few you tube video on how to set the path variable in java after installation.
Here is the couple of link-
https://www.youtube.com/results?search_query=how+to+set+path+variable+for+java+in+windows+10
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 4 years ago.
Improve this question
This question has been asked various times across this forum but none of these seem to be stemming from the same issue I'm having. So here is my issue...
I have multiple runnable jar files I use for various projects, these are Selenium projects if that makes more sense. I've not had any issues with any of these jars in the past and I have two servers running all the jars. I am able to run the other jars just fine so can't figure out what the issue is. Only thing that is new is I added some new dependencies in this specific project. On two of my machines this jar works fine. I stored the jar on the network and ran it from these two machines - works fine. Run it from the server machine and I get "Invalid of corrupt jarFile xxx.jar". Since this error is so generic I have no idea what to go on...
Run the jar by using "java -jar xxx.jar [params]".
I did notice that the java version on my two machines is 1.8 and the server is 1.7 however the project is built on java 1.7.
Any idea on this?
I would use a comment for you but I don't have the reputation to comment yet so here goes:
The java version is very possibly an issue. I know that I have had some serious issues very much like what you are explaining because I was using 1.8 (while the project was a 1.6 or 1.7). So using 1.7 instead of 1.8 could definitely be an issue.
I know this doesn't answer your question completely but if possible I would try upgrading your server (probably not an option I know).
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
i've to modify a plugin for my minecraft server (yes, i'm allowed to do it).
The problem is that the files that i've to modify have .class extension and despite a found a way to see those files with jd-Gui, i did not found a way to edit them. Can you please explain me step by step how to do it?
p.s. I use MacOsX system.
Thanks to all of you.
It is not a good idea to edit .class files because of dependencies and relationship with other classes. Also because .class contains byte information and not recommended (not possible in many cases) to edit it manually. The file is generated when you compile your java file. So, find the java source file, compile it, and it will update the .class file.
Good luck.