0

When I try to open a java file I get an error :

could not find or load main class + location of the file

I'll give an example , let's say I have a file.java in my C:\Program Files\Folder.

When i'll try to open that file it'll say :

Could not find or load main class C:\Program Files\Folder\File.java

I looked all around google and I found things about environmental variables , but I have already set my classpath and path.

MIGHT BE IMPORTANT : I use Jdk 1.8.0_25

Mr Empty
  • 31
  • 1
  • 1
  • 1

1 Answers1

0

.java files are not meant to be launched with java command.

You should compile it first with javac that will produce a .class file then if it's a class with a main method you can use java command.

Since you seem completely lost I would suggest reading at least the java documentation and do a welcome tutorial.

Note that if as you stated in your other question (which should be closed now) that you want to run a game server, just download already compiled classes not the sources.

Michael Laffargue
  • 10,116
  • 6
  • 42
  • 76