2

I've included the command line statements:

start rmiregistry

java -cp C:\Users\SUPER\Desktop\ch14RMI\pi\compute.jar   
-Djava.rmi.server.codebase=file:/C:/Users/SUPER/Desktop/ch14RMI/pi/compute.jar  
-Djava.rmi.server.hostname=localhost 
-Djava.security.policy=server.policy 
engine.ComputeEngine

And I am getting the error:

Error: Could not find or load main class engine.ComputeEngine Caused by: java.lang.ClassNotFoundException: engine.ComputeEngine

The directory of each of the files is as follows:

  • The client files are in ./client
  • The compute files are in ./compute
  • The engine file are in ./engine

The remaining policy files and the outputted JAR file are in ./

WHERE ./ is the directory C:/Users/SUPER/Desktop/ch14RMI/pi/

Full disclosure: This is for school. The actual assignment is more expansive than this, and I wish to complete that part myself. The reason I have posted it here is because the resources I've been given to complete this are out of date, and the teacher has not updated the course, nor does he use Windows 10. I have no classmates to ask directly (Self-directed learning), so I am in a bit of a pickle. I don't believe I am doing anything wrong by asking this, academically speaking, due to the nature of the problem.

Even if you are unwilling to provide me with the , it would be greatly appreciated if you could point me in the right direction.

Thanks

EDIT: Added the contents of compute.jar file:

C:\Users\SUPER>jar tvf 
C:\Users\SUPER\Desktop\SChool\COMP348JavaNetworkProgramming\Notes\ch14RMI\pi\compute.jar

     0 Mon May 30 21:15:40 MST 2022 META-INF/

    68 Mon May 30 21:15:40 MST 2022 META-INF/MANIFEST.MF

   307 Mon May 30 21:15:40 MST 2022 compute/Compute.class

   217 Mon May 30 21:15:40 MST 2022 compute/Task.class
  • Have you tried searching for RMI tutorials? [RMI](https://docs.oracle.com/javase/tutorial/rmi/index.html) and [Getting Started with Java RMI](https://www.baeldung.com/java-rmi) are two of many that exist. – Abra May 31 '22 at 05:29
  • Thanks for replying, @Abra. I added the edit. I have spent some time using several tutorials. I will also review the one you sent me. I'm sure i've missed something along the way. – Jordan Fitzmichael Kennedy May 31 '22 at 06:49
  • I agree with Java. I don't see `engine/ComputeEngine.class` anywhere in your JAR file. This is not even an RMI question, just a basic `java` command line question. – user207421 May 31 '22 at 06:57
  • @user207421 I just checked over why that might have happened. I tried both the jar file supplied by the teacher and the one i produced myself. They both produce the same output. When i review the documentation (this problem is an extension of an example) it confirms that only the interfaces Compute and Task need to be in the jar file. https://docs.oracle.com/javase/tutorial/rmi/compiling.html I dont think that's the issue! But i sincerely wish it was. – Jordan Fitzmichael Kennedy May 31 '22 at 07:14
  • So where *is* `engine/ComputeEngine.class`? The `engine` directory needs to be in your current working directory when you execute the `java` command, for both client and server, and the `rmiregistry` command. – user207421 May 31 '22 at 08:20

0 Answers0