How to import and use Jasypt - Java Library - java

I'm trying to use "Jasypt" in my Java project, but I'm having some troubles. I'm using NetBeans IDE.
I download this file, then I right clicked on my project -> Properties -> Library -> Add Jar/Folder. So, I add the folder of Jasypt (uncompressed, called "jasypt-1.9.0").
I can see the Jasypt folder in my project now, but when I try to use it, I have troubles. When I try to instantiate the "BasicPasswordEncryptor" (following my code) I got an error.
import org.jasypt.util.text.BasicPasswordEncryptor;
public class GerenciarConexao {
public boolean Login(String nome, String senha){
BasicPasswordEncryptor passwordEncryptor = new BasicPasswordEncryptor();
// (later will add the code)
return true;
}
}
This is the "inline error":
package org.jasypt.util.text does not exist
If I tr to build my project, I got the following error:
C:\Users\silvio\Documents\NetBeansProjects\LocusView\src\control\GerenciarConexao.java:6: error: package org.jasypt.util.text does not exist
import org.jasypt.util.text.BasicTextEncryptor;
C:\Users\silvio\Documents\NetBeansProjects\LocusView\src\control\GerenciarConexao.java:15: error: cannot find symbol
BasicPasswordEncryptor passwordEncryptor = new BasicPasswordEncryptor();
symbol: class BasicPasswordEncryptor
location: class GerenciarConexao
C:\Users\silvio\Documents\NetBeansProjects\LocusView\src\control\GerenciarConexao.java:15: error: cannot find symbol
BasicPasswordEncryptor passwordEncryptor = new BasicPasswordEncryptor();
symbol: class BasicPasswordEncryptor
location: class GerenciarConexao
3 errors
About this import, I don't know why is this path, I just find a question about Jasypt in StackOverflow and copy/paste the import to my project - I didn't find a easy guide that tell me how to install/use the Jasypt.
Thanks friends, waiting for answers - and sorry about my nonsense.

BasicPasswordEncryptor does not exist use BasicTextEncryptor instead

Related

ICollection and decimal.Divide for Java

I imported a program from Github. It is written in C# and I convert the codes to Java. Everything works except one, the method that needs ICollection and decimal.Divide.
Are there ICollection and decimal.Divide for Java? Or alternatives?
I opened Apache NetBeans and it shows:
cannot find symbol
symbol: class ICollection
location: class MathFormulas
cannot find symbol
symbol: variable decimal
location: class MathFormulas

importing a valid package is causing a java compiler error

I am getting a compiler error when compiling Order.java file even when it contains an import statement for the other packaged class. Im not entirely sure why this is happening but here is a directory tree with some files that I have:
com/my/domain/Order.java
Inside this file are the following package and imports:
package domain;
import utils.MyDate;
com/my/utils/MyDate.java
Inside this file are the following package and imports:
package utils;
Compiler error I get when compiling Order.java :
Order.java:2: error: package com.my.utils does not exist
import com.my.utils.MyDate;
^
Order.java:5: error: cannot find symbol
public MyDate orderDate;
^
symbol: class MyDate
location: class Order
Order.java:16: error: cannot find symbol
public Order(MyDate d, double amt, String c, String p, int q){
^
symbol: class MyDate
location: class Order
Order.java:24: error: cannot find symbol
public Order (MyDate d, double amt, String c) {
^
symbol: class MyDate
location: class Order
4 errors
I am still unsure how to solve this after trying form the comments. Here is some more detail.
Existing Statements in .bash_profile :
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home
export CLASSPATH=${CLASSPATH}:/Users/3aCaGa/Desktop/Java-SE-8-Programs/SimplifiedDateClass/com/my
How I am trying to compile? I am going to the java file location in the directory and running command for example :
java Order.java
For more detail on the files that and their exact contents see:
https://github.com/gosem01/Java-SE-8-Programs/tree/master/SimplifiedDateClass/com/my
Your package and import statements do not match your directory structure.
Your Order.class should have:
package com.my.domain;
import com.my.utils.MyDate;
and the Utils.class:
package com.my.utils;
To compile go to the directory where you can "see" the com folder and do:
*nix/MacOS
javac -cp . com/my/domain/*.java com/my/utils/*.java
Windows
javac -cp . com\my\domain\*.java com\my\utils\*.java
Hope it helps

How can I add java client library in java on netbeans?

Hello i read that I have to use the java client library in java to get the revisions list in google drive using google api. I use netbeans. I search for this question and I try to add the bib but i haven't get success. To download the library i visited this link and downloaded the "latest". but after add the jar files I get the message error that the package doesnt exist. Please someone help me!
Yes! I try this but it show the same erros. I add the lib but netbeans (8) show the error in the three lines code: "package [name] doesn't exist".
The three lines are these:
import com.google.api.services.drive.Drive;
import com.google.api.services.drive.model.Revision;
import com.google.api.services.drive.model.RevisionList;
obs: the full code, taken in the google developers site is:
package javaapplication8;
import com.google.api.services.drive.Drive;
import com.google.api.services.drive.model.Revision;
import com.google.api.services.drive.model.RevisionList;
import java.io.IOException;
import java.util.List;
public class MyClass {
private static List<Revision> retrieveRevisions(Drive service,
String fileId) {
fileId = "1XpNdeTFBr2KygyfPtlowBvkpcaJJzjgLckrGjp5oOhg0";
try {
RevisionList revisions = service.revisions().list(fileId).execute();
return revisions.getItems();
} catch (IOException e) {
System.out.println("An error occurred: " + e);
}
return null;
}
}
If it is the error like package is missing, please check whether you have created a folder named com in your project or not. Also, every dot (.) indicates the levels of packages that you use in your project. Please check that com folder followed by the other folder names after every dot are present or not. I think this might help you. I answered your question based on my understanding (i.e, package issue which will be resolved by creating folders in your project. folders means packages). I am sorry if I gave you the wrong answer.

Cannot Find getWindow(Applet) in netscape.javascript.JSObject

I am trying to call JavaScript functions from a JApplet. I've searched through tutorials and they say that I need to import and use netscape.javascript.* from my \jre\lib\plugin.jar
I did import netscape.javascript.* and I'm using DrJava, and it kept saying it cannot find the getWindow method.
This is the error it gives me:
(MinesweeperApplet extends JApplet)
Error: cannot find symbol
symbol: method getWindow(MinesweeperApplet)
location: class netscape.javascript.JSObject
This is the piece of code inside the MinesweeperApplet class where I am trying to get the JSObject:
public void start(){
// add stuff
JSObject window = JSObject.getWindow(this);
Container cp = getContentPane();
...
I appreciate any help. Thanks!
I have found the "solution."
Previously I was using JDK 7. Then I downloaded and tried JDK 6 (update 45) and it could compile fine. And from that point on, the Java-to-Javascript communication works.

How to get JOGL on Ubuntu 11.10 to work

any help greatly appreciated.
Problem: Ubuntu 11.10 not playing nice with Java's JOGL
Summary of what has been established:
JDK ok
Environment variables ok
JOGL Jars and lib ok
Test file used ok
Very unlikely to be EBKAC
file permissions ok
Problem caused by Ubuntu 11.10, (can has help?)
Potential solution - how do you install libjogl-java_1.1.1+dak1.orig.tar.gz ?
Details of what has been established:
JOGL was working fine with Ubuntu 11.04. Test file "T1.java" displayed a wireframe cube correctly.
After updating Ubuntu to 11.10, when run in Eclipse the JOGL frame always froze not showing any JOGL goodness.
I tried running a Java applet to check if java was broken, it worked fine. Java not broken.
Checked my jogl user library in Eclipse, looks fine. Native library set correctly for all jars.
I tried running the file in a terminal
cd ~/workspace/projectname/src/packagename/
javac T1.java
and got 32 errors complaining that the packages could not be found. At this point I realised this is NOT an eclipse problem.
I changed environment variables at /etc/environment and /etc/profile, such that running:
echo $PATH
echo $CLASSPATH
and
echo $JAVA_HOME
all display ~/librambo/jar and ~/librambo/lib as they should (plus the JDK correctly appeared in PATH)
(~/librambo is /home/rambo/librambo , rambo = username)
I tried putting the simple "T1.java" inside ~/librambo/jar and javac 'ing it from there, same problem. Then I tried:
javac -classpath jogl.all.jar T1.java
to determine if it would reduce the number of errors, and it claimed "error reading jogl.all.jar; error in opening zip file"
After extracting the jar file, it compiled but would not run. Running
ldd *.so
in the terminal, I saw it lacked "libjawt.so", as it complained "not found".
After finding that library file and copying it into the ~/librambo/jar folder, it (ldd *.so) then complained about several other library packages, such as libmawt.so, libjvm.so etc. After they also joined the horrendous pool of files congregating in ~/librambo/jar, upon ldd'ing again it complained it could now not find libjawt.so - but I just 'fixed' that problem...
I also "gksu nautilus" 'd my way over to them jar files, and set their permissions to read/write for all users, and allowed them to be ran as executables.
I had been using sun-java-6, so in paranoia I decided to remove the other java SDKs in /usr/lib/jvm to prevent interference from there being too many jar files confusing it. Same problem. Installed JDK1.7.0, cleared out ~/librambo/jar leaving only the 4 jars (and T1.java), wouldn't compile - same 32 errors again. (I used "sudo update-alternatives --config java" to set the java version, I used java -version to check what version I'm using so thats not the problem =p)
THis time downloaded jogl-linux-amd64.7z fresh, within it opened java-jogl-src.zip and copied the contents to /~librambo/jar again to see if I could just get it to work in this folder, 100 errors because the directory structure didn't match.
I have trawled much internets looking for answers for days, and I think I may finally have found it:
https://launchpad.net/ubuntu/oneiric/+source/libjogl-java/1.1.1+dak1-10
it says in the change log "Update the patch to set java.library.path" which is in keeping with an error I encountered (at some point). Unfortunately, when I download libjogl-java_1.1.1+dak1.orig.tar.gz and opened it, I realised I have no idea what I'm supposed to be doing with the contents. Could anyone tell me what to do to 'install' them?
Alternatively, here is the appendix, which contains the file hierarchy, /etc/environment setup, the 32 errors output, and a list of references which I have checked already.
////////////////////////////////////////
APPENDIX
////////////////////////////////////////
FILE HIERARCHY
/home/rambo/librambo/jar/ gluegen-rt.jar
/home/rambo/librambo/jar/ jogl.all.jar
/home/rambo/librambo/jar/ jogl-all-natives-linux-amd64.jar
/home/rambo/librambo/jar/ newt.event.jar
/home/rambo/librambo/jar/ T1.java #and a host of other files, have since been removed, thus the 32 errors came back.
/home/rambo/librambo/lib/ libgluegen-rt.so
/home/rambo/librambo/lib/ libjogl_desktop.so
/home/rambo/librambo/lib/ libjogl_mobile.so
/home/rambo/librambo/lib/ libnativewindow_awt.so
/home/rambo/librambo/lib/ libnativewindow_x11.so
/home/rambo/librambo/lib/ libnewt.so
ENVIRONMENT VARIABLES
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:~/.rvm/bin:/home/rambo/librambo/jar:/home/rambo/librambo/lib:/usr/lib/jvm/jdk1.7.0/bin:/usr/lib/jvm/jdk1.7.0/lib:/usr/lib/jvm/jdk1.7.0/jre/lib/amd64"
JAVA_HOME="/usr/lib/jvm/jdk1.7.0/bin:/usr/lib/jvm/jdk1.7.0/lib:/usr/lib/jvm/jdk1.7.0/jre/lib/amd64:/home/rambo/librambo/jar:/home/rambo/librambo/lib"
CLASSPATH="/usr/lib/jvm/jdk1.7.0/bin:/usr/lib/jvm/jdk1.7.0/lib:/usr/lib/jvm/jdk1.7.0/jre/lib/amd64:/home/rambo/librambo/jar:/home/rambo/librambo/lib"
32 ERRORS
rambo#rambo-ThinkPad-SL510:~/librambo/jar$ javac T1.java
T1.java:3: package javax.media.opengl does not exist
import javax.media.opengl.*;
^
T1.java:4: package javax.media.opengl.awt does not exist
import javax.media.opengl.awt.GLCanvas;
^
T1.java:5: package com.jogamp.opengl.util does not exist
import com.jogamp.opengl.util.*;
^
T1.java:6: package javax.media.opengl.glu does not exist
import javax.media.opengl.glu.GLU;
^
T1.java:7: package com.jogamp.opengl.util.gl2 does not exist
import com.jogamp.opengl.util.gl2.GLUT;
^
T1.java:9: cannot find symbol
symbol: class GLEventListener
public class T1 extends Frame implements GLEventListener, ActionListener {
^
T1.java:17: cannot find symbol
symbol : class GLCanvas
location: class T1
private GLCanvas canvas;
^
T1.java:75: cannot find symbol
symbol : class GLAutoDrawable
location: class T1
public void display(GLAutoDrawable drawable) {
^
T1.java:81: cannot find symbol
symbol : class GLAutoDrawable
location: class T1
public void dispose(GLAutoDrawable drawable) {
^
T1.java:85: cannot find symbol
symbol : class GLAutoDrawable
location: class T1
public void init (GLAutoDrawable drawable) {
^
T1.java:92: cannot find symbol
symbol : class GLAutoDrawable
location: class T1
public void reshape (GLAutoDrawable drawable, int x, int y, int width, int height) {
^
T1.java:115: cannot find symbol
symbol : class GLU
location: class Scene
private GLU glu = new GLU();
^
T1.java:116: cannot find symbol
symbol : class GLUT
location: class Scene
private GLUT glut = new GLUT();
^
T1.java:133: cannot find symbol
symbol : class GL2
location: class Scene
public void render(GL2 gl) {
^
T1.java:145: cannot find symbol
symbol : class GL2
location: class Scene
private void drawAxes(GL2 gl) {
^
T1.java:20: cannot find symbol
symbol : variable GLProfile
location: class T1
GLProfile.initSingleton(true);
^
T1.java:29: cannot find symbol
symbol : class GLProfile
location: class T1
GLProfile glp = GLProfile.getDefault();
^
T1.java:29: cannot find symbol
symbol : variable GLProfile
location: class T1
GLProfile glp = GLProfile.getDefault();
^
T1.java:30: cannot find symbol
symbol : class GLCapabilities
location: class T1
GLCapabilities caps = new GLCapabilities(glp);
^
T1.java:30: cannot find symbol
symbol : class GLCapabilities
location: class T1
GLCapabilities caps = new GLCapabilities(glp);
^
T1.java:31: cannot find symbol
symbol : class GLCanvas
location: class T1
canvas = new GLCanvas(caps);
^
T1.java:56: cannot find symbol
symbol : class FPSAnimator
location: class T1
FPSAnimator animator = new FPSAnimator(canvas, 60);
^
T1.java:56: cannot find symbol
symbol : class FPSAnimator
location: class T1
FPSAnimator animator = new FPSAnimator(canvas, 60);
^
T1.java:76: cannot find symbol
symbol : class GL2
location: class T1
GL2 gl = drawable.getGL().getGL2();
^
T1.java:86: cannot find symbol
symbol : class GL2
location: class T1
GL2 gl = drawable.getGL().getGL2();
^
T1.java:93: cannot find symbol
symbol : class GL2
location: class T1
GL2 gl = drawable.getGL().getGL2();
^
T1.java:99: cannot find symbol
symbol : variable GL2
location: class T1
gl.glMatrixMode(GL2.GL_PROJECTION);
^
T1.java:108: cannot find symbol
symbol : variable GL2
location: class T1
gl.glMatrixMode(GL2.GL_MODELVIEW);
^
T1.java:115: cannot find symbol
symbol : class GLU
location: class Scene
private GLU glu = new GLU();
^
T1.java:116: cannot find symbol
symbol : class GLUT
location: class Scene
private GLUT glut = new GLUT();
^
T1.java:134: cannot find symbol
symbol : variable GL2
location: class Scene
gl.glClear(GL2.GL_COLOR_BUFFER_BIT);
^
T1.java:148: cannot find symbol
symbol : variable GL2
location: class Scene
gl.glBegin(GL2.GL_LINES);
^
32 errors
REFERENCES
(Truncated list)
http://www.leolol.com/drupal/game-programming
Ant build classpath jar generates "error in opening zip file"
http://forum.worldwindcentral.com/archive/index.php?t-10146.html
(Jogamp wiki pages, for installing Jogamp on Ubuntu 64bit)
JOGL does not work after reinstalling ubuntu
A graphics lecturer at my University
T** C*******, (anonymous) Vi wielding TDDaholic
http://www.google.com
////////////////////////////////////////
UPDATES
////////////////////////////////////////
DAY 5 of java jogl headache update
PROGRESS!! =D
Now only 20 errors related to... Android? =S
So I started a new folder /home/rambo/libme
I downloaded:
jogl-linux-amd64.7z 16-Sep-2011 13:50 7.0M
gluegen-linux-amd64.7z 16-Sep-2011 04:53 735K
from:
http://jogamp.org/deployment/jogamp-current/archive/jogamp-linux-amd64/
This time, i unpacked the 7zip files and saw a src zip folder in each. I copied the contents of both into libme, there were no overwrites - they share a similar folder structure though.
Then I changed the environment variables to point at libme. Then I moved T1.java into libme. Javac of T1 within libme gave the following complaint:
rambo#rambo-ThinkPad-SL510:~/libme$ javac T1.java
/home/rambo/libme/jogamp/common/os/android/PackageInfoUtil.java:30: package android.content does not exist
import android.content.*;
^
/home/rambo/libme/jogamp/common/os/android/PackageInfoUtil.java:31: package android.content.pm does not exist
import android.content.pm.*;
^
/home/rambo/libme/jogamp/common/os/android/PackageInfoUtil.java:32: package android.util does not exist
import android.util.Log;
^
/home/rambo/libme/jogamp/common/os/android/PackageInfoUtil.java:37: cannot find symbol
symbol : class PackageInfo
location: class jogamp.common.os.android.PackageInfoUtil
public static final PackageInfo getPackageInfo(String packageName) {
^
/home/rambo/libme/jogamp/common/os/android/PackageInfoUtil.java:41: cannot find symbol
symbol : class Context
location: class jogamp.common.os.android.PackageInfoUtil
public static final PackageInfo getPackageInfo(Context ctx, String packageName) {
^
/home/rambo/libme/jogamp/common/os/android/PackageInfoUtil.java:41: cannot find symbol
symbol : class PackageInfo
location: class jogamp.common.os.android.PackageInfoUtil
public static final PackageInfo getPackageInfo(Context ctx, String packageName) {
^
/home/rambo/libme/jogamp/common/os/android/StaticContext.java:30: package android.content does not exist
import android.content.*;
^
/home/rambo/libme/jogamp/common/os/android/StaticContext.java:31: package android.util does not exist
import android.util.Log;
^
/home/rambo/libme/jogamp/common/os/android/StaticContext.java:34: cannot find symbol
symbol : class Context
location: class jogamp.common.os.android.StaticContext
private static Context context = null;
^
/home/rambo/libme/jogamp/common/os/android/StaticContext.java:37: cannot find symbol
symbol : class Context
location: class jogamp.common.os.android.StaticContext
public static final synchronized void setContext(Context ctx) {
^
/home/rambo/libme/jogamp/common/os/android/StaticContext.java:41: cannot find symbol
symbol : class Context
location: class jogamp.common.os.android.StaticContext
public static final synchronized Context getContext() {
^
/home/rambo/libme/jogamp/common/os/android/PackageInfoUtil.java:44: cannot find symbol
symbol : class PackageInfo
location: class jogamp.common.os.android.PackageInfoUtil
final PackageInfo pi = ctx.getPackageManager().getPackageInfo(packageName, PackageManager.GET_META_DATA);
^
/home/rambo/libme/jogamp/common/os/android/PackageInfoUtil.java:44: cannot find symbol
symbol : variable PackageManager
location: class jogamp.common.os.android.PackageInfoUtil
final PackageInfo pi = ctx.getPackageManager().getPackageInfo(packageName, PackageManager.GET_META_DATA);
^
/home/rambo/libme/jogamp/common/os/android/PackageInfoUtil.java:45: cannot find symbol
symbol : variable Log
location: class jogamp.common.os.android.PackageInfoUtil
if(DEBUG) Log.d(MD.TAG, "getPackageInfo("+packageName+"): "+pi);
^
/home/rambo/libme/jogamp/common/os/android/PackageInfoUtil.java:47: cannot find symbol
symbol : variable Log
location: class jogamp.common.os.android.PackageInfoUtil
} catch (Exception e) { if(DEBUG) { Log.d(MD.TAG, "getPackageInfo("+packageName+")", e); } }
^
/home/rambo/libme/jogamp/common/os/android/PackageInfoUtil.java:49: cannot find symbol
symbol : variable Log
location: class jogamp.common.os.android.PackageInfoUtil
if(DEBUG) Log.d(MD.TAG, "getPackageInfo("+packageName+"): NULL");
^
/home/rambo/libme/jogamp/common/os/android/PackageInfoUtil.java:54: cannot find symbol
symbol : class PackageInfo
location: class jogamp.common.os.android.PackageInfoUtil
final PackageInfo pInfo = getPackageInfo(packageName);
^
/home/rambo/libme/jogamp/common/os/android/PackageInfoUtil.java:58: cannot find symbol
symbol : class PackageInfo
location: class jogamp.common.os.android.PackageInfoUtil
final PackageInfo pInfo = getPackageInfo(packageName);
^
/home/rambo/libme/jogamp/common/os/android/PackageInfoUtil.java:60: cannot find symbol
symbol : variable Log
location: class jogamp.common.os.android.PackageInfoUtil
if(DEBUG) Log.d(MD.TAG, "getPackageInfoVersionName("+packageName+"): "+s);
^
/home/rambo/libme/jogamp/common/os/android/StaticContext.java:38: cannot find symbol
symbol : variable Log
location: class jogamp.common.os.android.StaticContext
if(DEBUG) Log.d(MD.TAG, "setContext("+ctx+")");
^
Note: /home/rambo/libme/javax/media/opengl/awt/GLCanvas.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
20 errors
Deleting the android folder didn't help.
(If i use just the jogl src and not the gluegen, it gives 100 errors. Adding the source from joal does nothing either)
openGL test
rambo#rambo-ThinkPad-SL510:~$ /usr/lib/nux/unity_support_test -p
OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: ATI Mobility Radeon HD 4500 Series
OpenGL version string: 3.3.11005 Compatibility Profile Context
Not software rendered: yes
Not blacklisted: yes
GLX fbconfig: yes
GLX texture from pixmap: yes
GL npot or rect textures: yes
GL vertex program: yes
GL fragment program: yes
GL vertex buffer object: yes
GL framebuffer object: yes
GL version is 1.4+: yes
Unity 3D supported: yes
I fixed it! =D
Are YOU suffering the same problem?
Symptoms
Have followed an excellent guide similar to: https://sites.google.com/site/justinscsstuff/jogl-tutorial-1 or http://www.leolol.com/drupal/game-programming
Eclipse opens a window but displays no openGL and the window hangs
The CLASSPATH and JAVA_HOME and PATH variables are all ok
It makes no sense, it should work
Cure
Hold onto your pantaloons, you're in for one wild night.
#_# "A thousand libraries, of the JOGL empire, descend upon you. Our JUnit tests, will blot out the sun"
¬_¬ "Then we will code in the shade"
Enter the following into a Terminal
sudo apt-get install gcc libgl1-mesa-dev libglu1-mesa-dev xorg-dev libice-dev libsm-dev libx11-dev libxext-dev libxxf86vm-dev libxinerama-dev libxrandr-dev libxrender-dev
sudo add-apt-repository ppa:eclipse-team/debian-package
sudo apt-get update
sudo apt-get install ant
It is assumed you use "git", if not then get it (google search, install). This guide was written for Java 1.7 (UPDATE: and Java 1.6), you can check your java version by typing
java -version
into the terminal. To change your default java version, type
sudo update-alternatives --config java
into the terminal - it displays the java versions you have installed, to choose from. Handy guides:
http://www.cyberciti.biz/faq/howto-ubuntu-linux-install-configure-jdk-jre/
https://help.ubuntu.com/community/Java
Now its Jogl time. Make a folder to put the source code to jogl onto your computer 0_0. For no particular reason, I will name the folder "hera" and put it into my home directory.
cd ~
mkdir hera
cd hera/
git clone git://jogamp.org/srv/scm/gluegen.git gluegen
git clone git://jogamp.org/srv/scm/jogl.git jogl
then goto ~/hera/jogl/doc/HowToBuild.html and it will tell you the next steps, though read these "how to build notes":
how to build notes
These are guide notes to the guide notes for JOGL, which you just GIT cloned into your computer at ~/hera/jogl/doc/HowToBuild.html
Advanced Users: It is important to note that "source /etc/environment" in insufficient when changing the environment variables in this case; in simples that means you need to do the next command to change your PATH (and other variables), LOG OUT and then LOG IN again to your Ubuntu.
gksu gedit /etc/environment
That command opens up your environment variables. Time for exterminatus. Remove all traces of ANYTHING java-like, including paths to SDKs. CLASSPATH and JAVA_HOME need to be deleted (copy them somewhere else so you can put them back later). You should have something like:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:~/.rvm/bin
Notice the no java there. Save and close. Log out, log in. Then check it worked with:
echo $PATH
If you see any java goodness despite the log out -> in, then "gksu gedit /etc/profile" and see if you have any "export" statements lingering in there which refer to PATH or CLASSPATH or JAVA_HOME. If nothing there... check ".bashrc" in home?
Advanced Users: The next paragraph goes through the building of Jogl. The Java version you use to do the building of Jogl is significant; it is the Java version your code will have to be to use it. If you want to develop projects (which use Jogl) in Java 1.6 and Java 1.7, then you'll need separate folders with separate builds of Jogl - for example "~/hera/" built with Java 1.7, "~/zeus/" built with Java 1.6.
Assuming everything is okay and there are no java paths showing, continue with the HowToBuild.html. I didn't change the optional build properties. Do the "ant" build thing the guide refers to. If you do the JUnit testing, it takes about 30mins, and appears to freeze a few times and not use any CPU. This is ok, just leave it for a while.
If the test doesn't work, it could potentially be because your unfortunate timing meant you've pulled a broken build. You can wait and git pull (from hera), or SHA1 your way back a few PUSHes.
Finally
Assuming you're using eclipse. Delete your old jogl user library that you made (if you made one). I also recommend starting a fresh project. Follow the guide (e.g. https://sites.google.com/site/justinscsstuff/jogl-tutorial-1 or http://www.leolol.com/drupal/game-programming) as normal, the following jars can be found in ~/hera/jogl/build/jar/ (If you're using Java 1.6, you'll have to ratch in ~/hera/jogl/builf/jar/atomic)
jogl.all.jar
jogl-all-natives-amd64.jar
newt.event.jar
their Native Library Location is in "~/hera/jogl/build/lib" . Then "gluegen-rt.jar" is found in "~/hera/gluegen/build" , I set the library to be the same one as for the other 3 jars... I suspect the presence of "libgluegen-rt.so" might have been fouling things up, one doesn't seem to need it...
Now your program should run!
At this point, you can put the PATH, CLASSPATH and JAVA_HOME variables back into /etc/environment (which were removed for the ant thing).
Wow, you could save yourself a world of pain by using maven to handle your projects dependencies. See here:
How to make jogl work with intellij idea

Categories

Resources