Import projects into workspace

It’s recommended to create a new workspace for censhare projects.

  • Use “File > Import > Import existing projects into workspace” to import projects

Projects to import:

  • censhare-LibSupport
  • censhare-Server
  • censhare-Client5

Projects

Debugging

In order to debug any issues on the server side, a debug configuration for Remote Java Application has to be set up.

  • Open the Debug Configuration window by going to menu “Run > Debug configurations”

Debug configurations

  • Create a new Remote Java Application debug connection
  • Set the settings as shown on the picture below:

censhare-Server debug configuration

  • Select the censhare-Server as Project and then press “Debug” to start debugging

Note! The given configuration will connect to the running local censhare server.

Deploying

The code will be automatically deployed upon browser refresh, as long as the Development mode is on.

General preferences

  • Define the sorting of import statements for automatic organizing

Configuration of imports

  • Prevent the storing of trailing whitespace

Configuration of imports

  • censhare’s XML schemas for comfortable editing with autosuggestion and validation

Configuration of imports

Codestyle

Make sure to following our Codestyle rules for a correct code format.

Compiler preferences

  • Error severity level

errors

codestyle
progproblems
nameshadowing
deprecatedapi
unnecessarycode
generictypes
annotations

  • Javadoc preferences

javadoc

  • Task tags definitions

tags

More detailed explanation on the task tags definitions can be found here.

Project configuration

In the Eclipse project structure - branch versions have a different prefix on the project’s name (e.g. stable, 5.4).
Eclipse projects structure

Any of these projects should contain their own run configurations for the client applications (e.g. censhare-Client, censhare-Admin).
If the running server is using an additional launcher application, a separated configuration needs to be done for the project to run within Eclipse.

Example (use your own server id instead of sva):

Eclipse run server 1
Eclipse run server 2

Example content of VM arguments:

-Xms768m -Xmx768m -XX:+UseCompressedOops -XX:NewSize=64M -XX:MaxNewSize=64M -XX:SurvivorRatio=16 -XX:MaxTenuringThreshold=15 -XX:TargetSurvivorRatio=50 -XX:-UseParallelGC -XX:-UseParallelOldGC -Djava.util.logging.manager=com.censhare.support.util.logging.CustomLogManager -Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl -Djava.security.manager=java.rmi.RMISecurityManager -Djava.security.policy=work/runtime.**{server_name}**/config/censhareserver.policy -Djava.security.properties=work/runtime.**{server_name}**/config/security.properties -Dcom.sun.management.config.file=work/runtime.**{server_name}**/config/management.properties

It might be caught from the console when the server is running.

JVM options for censhare-Client

Running the Java Client from within Eclipse requires adding the following JVM options in the module’s compiler settings. These options are used both during compile time and runtime.

  • Go to Project > Properties: Java Build Path, tab Libraries
  • Select the JRE > Is modular node and click Edit…
  • Go to the tab Details
  • In the Added exports section click Add…
  • Enter the below JVM options using the following example:
    • Source module: java.desktop
    • Package: java.awt.peer

--add-exports
java.desktop/java.awt.peer=ALL-UNNAMED
--add-exports
java.desktop/sun.lwawt=ALL-UNNAMED
--add-exports
java.desktop/sun.lwawt.macosx=ALL-UNNAMED
--add-exports
java.desktop/com.apple.laf=ALL-UNNAMED
--add-exports
java.desktop/sun.awt=ALL-UNNAMED

buildLibraries

censhare VFS FAQ

Avoiding errors

  • Load / Unload censhareVFS (Mac)
    • Load: Copy CenshareFS.kext from censhare-product/censhare_Vfs/bin to a new location

    sudo chown -R root:wheel censhare-product/CenshareFS.kext
    sudo kextload censhare-product/CenshareFS.kext

    • Unload:

    sudo kextunload /System/Library/Extensions/CenshareFS.kext/

    • Check status:

    kextstatCopy

IDE Eclipse: Failed to create virtual filesystem

Error Message: Failed to create virtual filesystem “localhost”: com/censhare/vfs/AbstractCsVfs: Unsupported major.minor version 51.0
Solution: You’re using the wrong Java version to build the VFS. The VFS requires Java 6 because the underlying native libs are compiled against Java 6.

  • Open properties of the project “censhare-VFS” and navigate to “Java Build Path”. Make sure Java 1.6 is selected as JRE System Library.

vfseclipse01

  • Navigate to “Java Compiler” and select “Enable project specific settings” and “Use compliance from execution environment Java 1.6 in the Java Build Path.”.

vfseclipse2

  • No labels