0% found this document useful (0 votes)
34 views1 page

Steps Dining Philosopher1 PDF

1. To open the Mongo shell, install MongoDB, create the /data/db directory, start the mongod process, and open the mongo shell client. 2. To execute a Java program in Eclipse that uses MongoDB, create a Java project, add the MongoDB Java driver JAR file to the build path and run configurations, and write and run the Java code. 3. If errors occur, check that the /data/db directory is created correctly and permissions are set properly for mongod and mongo processes.

Uploaded by

Pooja Ban
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views1 page

Steps Dining Philosopher1 PDF

1. To open the Mongo shell, install MongoDB, create the /data/db directory, start the mongod process, and open the mongo shell client. 2. To execute a Java program in Eclipse that uses MongoDB, create a Java project, add the MongoDB Java driver JAR file to the build path and run configurations, and write and run the Java code. 3. If errors occur, check that the /data/db directory is created correctly and permissions are set properly for mongod and mongo processes.

Uploaded by

Pooja Ban
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

----------------------------------------------------------------------------------------------------------------------------

Steps for executing Dining Philosopher's Problem

1.Steps for opening Mongo shell:


1.1.We should have "mongodb-linux-x86_64-2.6.3" on our system.If you dont have it copy it and paste
it.
1.2. check if "/data/db" folder is present in root folder.If it is not present there create "data" folder in
root diectory and then "db" folder in that directory through terminal using mkdir command.
1.3. Open terminal:
1.3.1. Get into super user mode: $su
1.3.2. Go into "mongodb-linux-x86_64-2.6.3/bin" folder: #cd mongodb-linux-x86_64-2.6.3/bin
1.3.3. Start ./mongod: bin#]./mongod
1.3.3.1. If it says permission denied,change the permission by using: bin#]chmod
777 ./mongod
1.3.3.2. It will start and give output as something like: bin#]waiting for connections:......
1.4. Open another terminal:
1.4.1. It should be in "mongodb-linux-x86_64-2.6.3/bin" folder.
1.4.2. To start mongo shell: bin#]./mongo (if it asks for permissions: do same as said for
./mongod)
1.4.3. Mongo shell will appear: connecting to test ... >

Note: If you face any problem in getting above said output by executing same steps as
said..........please delete already created "/data/db" folder through terminal and create new
"/data/db" folder again and do above steps.

2.Steps for executing given program in eclipse:


2.1. Open Eclipse and create new "java project".
2.2. Right click on project and create new "class".
2.3. Type the whole code in this class.

Note: Actually we are having two classes in our program but we have written both the classes
in same ".java(class file)".We can make two java class files in same default package and write
different classes in different class files........but I haven't tried it in that way.....

2.4. Right click on project folder in project explorer.Goto Properties.


2.5. In properties window, goto Java Build Path then to libraries tab and then add external
"mongodb-java-connector's" jar file there.
2.6 While running the code....Goto to Run Configurations and there also add the same external
"mongodb-java-connector's" jar file in ClassPath tab.
2.7. Apply ---> Run

----------------------------------------------------------------------------------------------------------------------------

You might also like