Marauroa on NetBeans: Difference between revisions
imported>Hendrik Brummermann m moved NetBeansMarauroa to Marauroa on NetBeans |
imported>SimonSmall m →Start NetBeans: some clarification |
||
| Line 30: | Line 30: | ||
Start the NetBeans IDE. Close any open projects if they are not those covered here. |
Start the NetBeans IDE. Close any open projects if they are not those covered here. |
||
Click New Project, choose Java and Java Class Library. Click Next, then give the Project Name as marauroa. Change the Project Location to the top level location (DEVPATH, see above); the Project Folder is shown as DEVPATH\ |
Click New Project, choose Java and Java Class Library. Click Next, then give the Project Name as marauroa. Change the Project Location to the top level location (DEVPATH, see above); the Project Folder is shown as DEVPATH\marauroa with DEVPATH being your chosen location. Directory DEVPATH\marauroa must be empty (or not exist). |
||
The empty Project is created in NetBeans. Under the Files tab you will see the directory structure it has also generated; check this using your file explorer. |
The empty Project is created in NetBeans. Under the Files tab you will see the directory structure it has also generated; check this using your file explorer. |
||
Expand the Marauroa source file you have downloaded. Create a new directory named libs. Copy the files h2.jar, log4j.jar, jnlp.jar and jython.jar from the source file libs directory to this new directory. Copy the whole of the source file src directory to the src directory created by NetBeans. |
Expand the Marauroa source file you have downloaded. Create a new directory named libs (i.e. DEVPATH\marauroa\libs). Copy the files h2.jar, log4j.jar, jnlp.jar and jython.jar from the source file libs directory to this new directory. Copy the whole of the source file src directory to the src directory created by NetBeans. |
||
Return to the NetBeans IDE. It should have rescanned the files and read them into the project. If not, select Source, Scan for External Changes from the menu. A red exclamation mark warning icon shows the location of several errors. Right click the Libraries branch of the Project tree, and select Add Jar/Folder. Browse to the the libs directory for this project and select the h2.jar file. Wait until the Scanning process has finished, then repeat for each of the jar files copied from the source file libs directory (or use Ctrl-click to select multiple jar files). All red warning icons should disappear. |
Return to the NetBeans IDE (Projects tab). It should have rescanned the files and read them into the project. If not, select Source, Scan for External Changes from the menu. A red exclamation mark warning icon shows the location of several errors. Right click the Libraries branch of the Project tree, and select Add Jar/Folder. Browse to the the libs directory for this project and select the h2.jar file. Wait until the Scanning process has finished, then repeat for each of the jar files copied from the source file libs directory (or use Ctrl-click to select multiple jar files). All red warning icons should disappear. |
||
NOTE: version 3.8.7 gives an error, as it does not override the abstract method getRemoteAddress() in java.nio.channels.SocketChannel for marauroa.tools.protocolanalyser.FakeSocketChannel. The red exclamation mark warning icon shows the location of this error. Expand the Project tree until this file is shown, double click it to show it in the editor pane then locate the class definition FakeSocketChannel in the code. Position the cursor in that line (left click) then press Alt-Enter and select the option Implement all abstract methods. This adds the following lines: |
NOTE: version 3.8.7 gives an error, as it does not override the abstract method getRemoteAddress() in java.nio.channels.SocketChannel for marauroa.tools.protocolanalyser.FakeSocketChannel. The red exclamation mark warning icon shows the location of this error. Expand the Project tree until this file is shown, double click it to show it in the editor pane then locate the class definition FakeSocketChannel in the code. Position the cursor in that line (left click) then press Alt-Enter and select the option Implement all abstract methods. This adds the following lines: |
||
<source lang="Java"> |
|||
<pre> |
|||
import java.net.SocketOption; |
import java.net.SocketOption; |
||
import java.util.Set; |
import java.util.Set; |
||
| Line 83: | Line 83: | ||
throw new UnsupportedOperationException("Not supported yet."); |
throw new UnsupportedOperationException("Not supported yet."); |
||
} |
} |
||
</ |
</source> |
||
== Build Marauroa == |
== Build Marauroa == |
||
Revision as of 17:11, 8 January 2012
Introduction
These instructions assume that you will install the minimum required to use the Marauroa engine. Additional features and functions are covered in separate pages.
Note that the Marauroa Engine is NOT a complete application. You will need to add more code to use it within a game application.
Requirements
If not already installed, you will need the following.
Java
The Marauroa engine is written using Java. You will need to install the Java Development Kit (JDK) from [1].
NetBeans
NetBeans is downloaded from [2]. It can be extended by installing a large number of plugins; if you are not sure, just use the default installation.
Marauroa Source
You can take the source code from the repositories, but these instructions use the released version available from the website, in this case the source marauroa-3.8.7-src.tar.gz [3].
Directory structures
The following directory structure is one suggestion and is used in the instructions. Choose a different one if you wish. You will need a location where you can save the files needed for development. The top level location is referred to as DEVPATH. Replace this with whatever you have chosen as that location. Do not create any sub-directories yet.
Start NetBeans
Start the NetBeans IDE. Close any open projects if they are not those covered here.
Click New Project, choose Java and Java Class Library. Click Next, then give the Project Name as marauroa. Change the Project Location to the top level location (DEVPATH, see above); the Project Folder is shown as DEVPATH\marauroa with DEVPATH being your chosen location. Directory DEVPATH\marauroa must be empty (or not exist).
The empty Project is created in NetBeans. Under the Files tab you will see the directory structure it has also generated; check this using your file explorer.
Expand the Marauroa source file you have downloaded. Create a new directory named libs (i.e. DEVPATH\marauroa\libs). Copy the files h2.jar, log4j.jar, jnlp.jar and jython.jar from the source file libs directory to this new directory. Copy the whole of the source file src directory to the src directory created by NetBeans.
Return to the NetBeans IDE (Projects tab). It should have rescanned the files and read them into the project. If not, select Source, Scan for External Changes from the menu. A red exclamation mark warning icon shows the location of several errors. Right click the Libraries branch of the Project tree, and select Add Jar/Folder. Browse to the the libs directory for this project and select the h2.jar file. Wait until the Scanning process has finished, then repeat for each of the jar files copied from the source file libs directory (or use Ctrl-click to select multiple jar files). All red warning icons should disappear.
NOTE: version 3.8.7 gives an error, as it does not override the abstract method getRemoteAddress() in java.nio.channels.SocketChannel for marauroa.tools.protocolanalyser.FakeSocketChannel. The red exclamation mark warning icon shows the location of this error. Expand the Project tree until this file is shown, double click it to show it in the editor pane then locate the class definition FakeSocketChannel in the code. Position the cursor in that line (left click) then press Alt-Enter and select the option Implement all abstract methods. This adds the following lines:
<source lang="Java"> import java.net.SocketOption; import java.util.Set;
@Override
public SocketChannel bind(SocketAddress local) throws IOException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public <T> SocketChannel setOption(SocketOption<T> name, T value) throws IOException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public SocketChannel shutdownInput() throws IOException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public SocketChannel shutdownOutput() throws IOException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public SocketAddress getRemoteAddress() throws IOException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public SocketAddress getLocalAddress() throws IOException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public <T> T getOption(SocketOption<T> name) throws IOException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public Set<SocketOption<?>> supportedOptions() {
throw new UnsupportedOperationException("Not supported yet.");
}
</source>
Build Marauroa
If there are no errors in the package, select Run, Clean and Build Project from the NetBeans menu bar. This will create marauroa.jar in the dist directory.
Select Run, Generate Javadoc from the NetBeans menu bar. This will create the Javadoc documentation files in the dist\javadoc directory, and open the index.html file from that directory in your web browser. The javadoc files contain the marauroa documentation extracted from the source files. Read them or ignore them, it is your choice; you do not have to create them. They will be useful when you are trying to understand the structure of the Marauroa Engine. To read them later, open the index.html in your web browser.
Completion
The files in the dist directory are the ones you will need for your game. This step has only created the marauroa library, not a game.