You are here: AGGeom » JavaView » JVInstallation

JVInstallation

This page describes three possibilities to implement and run JavaView, whereas the first one is the application offered on the JavaView webpage. The remaining versions address developers, whether they use the JavaView jars or have access to JavaView -SVN, with its additional JavaView Development area. All implementations are made in Eclipse.

Installation as Application

Download the installer from http://javaview.de/download/index.html and execute it.

Installation for Developers with JV jars

As a first step you need to install a Java JDK as well as the Eclipse IDE. Make sure to install both Java and Eclipse for the same architecture of your machine (32/64 bit resp. x86/x64).
  1. Install the latest Java JDK, available at Oracle.
  2. Download the Eclipse IDE for Java Developers from Eclipse.org and install/extract it.

Then go to the download section of the JavaView homepage for the latest stable release. Download the javaviewFull.zip and extract it to a folder named javaview.

Alternative: You can also download the installer for Windows (exe) or Linux (rpm) and install it to your system. Most likely it will be installed to some location like C:\Progamm Files\JavaView on Windows or /usr/share/ on Linux. We will refer to this location in the following simply as javaview, too.

Now you need to include JavaView as a new project in Eclipse:
  1. Open Eclipse and create a new workspace somewhere on your drive. The workspace is not necessarily the place where your source code or JavaView is located. See below, if you want to create an external source folder.
  2. In Eclipse, select File > New Project > Java Project. Enter as project name: "JavaView". Make sure that "Create separate folders for sources and class files" is selected.
  3. Hit Next
  4. In the Libraries tab, select Classpath as directory, click Add External Jars... and browse to your javaview folder. Add the files javaview/jars/javaview.jar, jvx.jar and vgpapp.jar.
  5. If You are asked to "Create module-info.java", click the "Don't create" button.
  6. Click Finish.

You have now created a new Java project called "JavaView" which you see on the left panel in Eclipse. To run JavaView in Eclipse, open Run > Run Configurations, choose Java Application > New configuration and name it "JavaView". As main class, choose javaview. Click Run, JavaView should now start.

Alternative (advanced): Separating source and workspace: The project creation as described above creates a new folder JavaView in your workspace directory, with a subfolder src where all the code is moved to. Sometimes it might be desirable to separate the source code from the eclipse workspace path (for instance if you have large projects and run in trouble with version control, e.g. see this link or that link). To put the source code in a separate directory and include it in the JavaView project as an external reference proceed as follows:

  1. Open Eclipse and create a new workspace somewhere on your drive. The workspace is not necessarily the place where your source code or JavaView is located.
  2. Create a new directory for your source code (in the following name sources ). Furthermore, create a subfolder named Base in the sources directory.
  3. In Eclipse, select File > New Project > Java Project. Enter as Project name: "JavaView". Under Project Layout, make sure that "Use project folder as root" is enabled and click next.
  4. On the Source tab, click "Link additional source", hit "Browse" and select sources/Base as a folder. Ensure that "Replace existing project source folder..." is selected, then click Finish.
  5. Back in the Java Settings window, click on the Libraries tab. Select Classpath as directory and click Add External Jars... and add the files javaview/jars/javaview.jar, jvx.jar and vgpapp.jar. Click Finish.

If you have any problems during this step, e.g. if some options are disabled or not possible to activate, then it is likely that you still have some leftovers from a previous try and therefore Eclipse automatically tries to set up something based on the existing folders or files. If this is the case, make sure you delete the project folder JavaView in your workspace directory (not the javaview folder of your JavaView installation!) using a file explorer from your operating system (e.g. Windows Explorer, Dolphin, …). Alternatively you can delete the project folder directly in Eclipse in which case you are asked whether the content on disk should also be deleted. Select this option and repeat all steps.

Import Tutorial Code and Running a Tutorial Project

As a good start for many projects in JavaView, tutorial code is provided. To import the code, in the package explorer of Eclipse, right-click the src folder and click Import. Choose General > File System and hit Next. Browse to the folder javaview/vgp and click Ok. A folder vgp should appear in the list on the left. Mark the checkbox Create top-level folder and click Finish. In your package explorer you now see a bunch of subfolders starting with vgp.tutor.xxx.

To run any tutorial project, select it. For instance, browse to vgp.tutor.parm. This folder should contain among others the source file PaParmSurface.java. Right-click this file and choose Run as Java Application.

Adding own Sources and the JavaView-JavaDoc to the project

It might be convenient to add a new folder for your own sources to the project. Right-click the JavaView project folder in the package explorer and select new > Source Folder. As name enter "mysource".

Alternative (advanced): mysources in external path: Here we will create a new "mysource" directory under your external source directory and link this to our project in Eclipse as follows:
  1. Create a new subfolder mysource under sources with your file browser (outside Eclipse). The sources directory should now contain two subfolders: Base and mysource.
  2. In Eclipse right-click on the JavaView top-level project folder and select Build Path > Link Source....
  3. Click Browse... and select the sources/mysource folder you have just created.
  4. Click Finish.

In the package explorer you should now see a second source folder mysource. You can now add own source code to this project. Remember to change the run configuration to your own class containing a Java main() -method.

You also may want to add the generated JavaDoc documentation for JavaView methods to your project to have automatic help, on what a method does, available when typing. To do so, go to your project folder "JavaView" in Eclipse and unfold the Referenced Libraries subfolder where you should find your three external libraries javaview.jar, jvx.jar, and vgpapp.jar you have added earlier. Right-click the javaview.jar and select Properties. Select Javadoc Location from the list on the left and browse to javaview/doc/reference, then hit OK.

Currently the DOC folder is missing in the release. This will be fixed in one of the following releases.

Installation for Developers with JV-SVN Access

Required Software

The following Software is required to use JavaView as a developer:
  • Java SE, JDK, download from Oracle
  • Tortoise SVN, download from TortoiseSVN.net
  • Eclipse IDE for Java Developers, download from Eclipse.org
  • (optional) Eclipse-SVN connector: Download the Subversive Zip archive from the Eclipse website. In Eclipse select Help > Install New Software… > Add… > Archive... and select your location of the installed Subversize Zip archive. Click add. Select all availabe items and click Next twice. Accept the terms of the licence agreement and click Finish. Restart Eclipse as required. Then go to Window > Preferences > Team > SVN > SVN Connector and click on Get Connectors.... Select a connector (for example SVN Kit) and click on Finish. Click Next twice, accept terms of the licence agreement and click Finish. Should a security warning pop up click on Install anyway and restart Eclipse as required. Finally you can use Subversive either as a Perspective by going to Window > Perspective > Open Perspective > Other... and choosing SVN Repository Exploring or by going to Window > Show View > Other... and choosing a View from the SVN folder.

SVN Checkout

Create the following folders in the File System in order to download the JavaView sources:
  • ./JavaView-SVN/
    • JavaView/
    • JavaViewDev/

Checkout the SVN repository JavaView. Do so by right-clicking on the folder JavaView. Choose "SVN Checkout". As URL enter https://johnson.imp.fu-berlin.de/svn/JavaView/trunk and click "Ok". If you do get a certificate warning, click on the "accept certificate permanently" button. Likewise checkout the SVN repository JavaViewDev. Right-click on the folder JavaViewDev, choose "SVN Checkout" and enter https://johnson.imp.fu-berlin.de/svn/JavaViewDev/trunk as URL. Click on "Ok".

Setup of Eclipse

First, create a workspace in the JavaView-SVN folder. This is done by launching eclipse and selecting the JavaView-SVN folder as workspace. Eclipse will create a subfolder .metadata in the folder JavaView-SVN. Go to the Eclipse Package Explorer (not the Project Explorer!). If it does not appear on the screen, click on Window > Show View > Other > Java > Package Explorer. Configure the Eclipse Package Explorer via its arrow-down button:
  • Select Top Level Elements: Working Sets
  • Select Package Presentation: Hierarchical
  • Disable "Show 'Referenced libraries' node"
  • In the "Filters" window only select the following items: .*resources, Empty library containers, Libraries from external, Libraries in project, Non-Java Elements
Now create a working set for both the JavaView and the JavaViewDev sources. To do so, right-click inside the Package Explorer and select "New" - "Java Working Set". Type the working set name "JavaView". Similarly, create a working set "JavaViewDev". Now import projects
  • … into working set "JavaView": Select "File" - "Import" - "General" - "Existing Projects into Workspace". Find the projects in folder ./JavaView-SVN/JavaView. Select the following projects and import them: _eclipse, srcBase, srcDoc
  • … into working set "JavaViewDev": Select "File" - "Import" - "General" - "Existing Projects into Workspace". Find the projects in folder ./JavaView-SVN/JavaViewDev. Select the following projects and import them: Develop, DevelopContrib, OpenGL_JOGL, OpenGL_JOGL2, OpenGL_LWJGL, ThirdLibs

Configuration of Eclipse

Load Java Preferences by "File" - "Import" - "General" - "Preferences" and pick the preference file from JavaView-SVN/JavaView/_eclipse/rsrc/javaview_javaCodeStylePrefs.epf, import all and press "Finish".

Open "Window" - "Preferences".
  • "General" - "Editors" - "Text Editors" - "Spelling": Set the user defined dictionary to ${workspace_loc:_eclipse/rsrc/javaview_userDictionary.txt}.
  • "Java" - "Build Path": For the "Source and output folder" pick "folders" and set "Source folder name" to "src" and "Output folder name" to "class".
  • "Java" - "Editor" - "Folding": Deselect "Imports".
  • "Java" - "Installed JREs": Add the jdk by "Add" - "Standard VM" in the directory "C:\Program Files\Java\jdkxxx" and select this jdk as Default
  • "Run/Debug" - "Launching" - "Launch Configurations": Deselect both "Filter configurations in closed projects" and "Filter configurations in deleted or missing projects". Select "Filter checked launch configurations" and Select all but the following: "Java Applet" and "Java Application".

In the "Markers" tab on the bottom, click the arrow-down button. Choose "Configure Contents..." ("Filters..." in Eclipse Oxygen). Uncheck "Show all items". Create a "New" configuration. Choose Scope → On selected element and its children.

Run Configurations

Every Eclipse run configuration launches a particular start method of a Java class. Use at least one run configurations per project. Sometimes, multiple configurations are needed, e.g. to provide extended memory for heavy models or to set up specific rendering options. Here are some important parameters that can be given as program arguments:
  • archive.dev=show Load the develop module at startup and add a menu entry to the Methods menu for functionality provided by develop methods. Note: sometimes you have to clean and rebuild the project to get this work.
  • model=... Load a specific geometry at startup
  • jv-lic=... Load a specific license file at startup (usually a personalized license file)

 
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback