Java access to curl lib - java

I just want to ask if java have access to the curl library?
I have already tried the link below:
http://chimpler.blogspot.com/2009/03/logging-to-ebay-with-java-curl.html
I Just downloaded the CurlGlue.java because it is also missing in the archive.
when it comes to compilation part (javac -classpath . se/haxx/curl/*.java) below is the error:
private native int jni_setopt(int i, int j, CurlRead curlread);
^
symbol: class CurlRead
location: class CurlGlue
se/haxx/curl/CurlGlue.java:48: error: cannot find symbol
private native int jni_setopt(int i, int j, CurlIO curlio);
^
symbol: class CurlIO
location: class CurlGlue
se/haxx/curl/CurlGlue.java:74: error: cannot find symbol
public int setopt(int i, CurlRead curlread)
^
symbol: class CurlRead
location: class CurlGlue
se/haxx/curl/CurlGlue.java:79: error: cannot find symbol
public int setopt(int i, CurlIO curlio)
^
symbol: class CurlIO
location: class CurlGlue
.......
If any one knows where to get the complete curl-java-master? Kindly let me know the link.
Thanks in advance.

There are a lot of different implementations of cURL in Java. The original one is https://github.com/pjlegato/curl-java, but that's not complete. There's others like https://code.google.com/p/java-curl-jar/ that seem promising.
Keep in mind, most of what cURL does can be done in other ways through Java, cURL isn't always necessary. It might be easier to go a different route.

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

Compiling java class with javac doesn't work

I want to compile my java class like that: javac ResultSet.java
But I get the following error:
ResultSet.java:5: error: package data does not exist
import data.Spieler;
^
ResultSet.java:8: error: cannot find symbol
private ArrayList<Spieler> meineSpieler = new ArrayList<Spieler>();
^
symbol: class Spieler
location: class ResultSet
ResultSet.java:12: error: cannot find symbol
public native Spieler[] getSpieler();
^
symbol: class Spieler
location: class ResultSet
ResultSet.java:18: error: cannot find symbol
public ArrayList<Spieler> getMeineSpieler() {
^
symbol: class Spieler
location: class ResultSet
ResultSet.java:8: error: cannot find symbol
private ArrayList<Spieler> meineSpieler = new ArrayList<Spieler>();
^
symbol: class Spieler
location: class ResultSet
How can I import the spieler class? Should I set the classpath or is there a other way to fix that?
Go one directory up and then compile it with
javac data/JNIResultSet.java
Update:
Ok, your class JNIResultSet is in package model and it uses other classes in package data.
Then your compile command should be as follows:
javac -cp . model/JNIResultSet.java
The -cp . part means, that your classpath includes the current directory. This is the root of your package hierarchy. So the compiler can find the *.java files in package data and compiles them also as needed.
You see, this can be very complicated. For more classes this will be nearly unmanageable. So you should really consider to use a build system like Ant, Maven or Gradle.
use -classpath while compiling the file as
javac -classpath <path-to-dependent-classes> JNIResultSet.java
It is required only when the Spieler is not on classpath!
for more help refer javac oracle documentation

Java :"error: cannot find symbol"

i'm a new to java and just bought this amazing book to start learning with. One of the exercises, it asked me to do this ( it's exactly like in the book ) :
class SimpleDotComTestDrive {
public static void main (String[] args) {
SimpleDotComTestDrive hu = new SimpleDotComTestDrive();
int[] locations = {2,3,4};
hu.setLocationCells(locations);
String userGuess = "2";
String result = hu.checkYourself(userGuess);
String testResult = "failed";
if (result.equals("hit") ) {
testResult = "passed";
}
System.out.println(testResult);
}
}
I compiled this code on Notepad++ which compiles normally for the pass few weeks , until i compiled this code and got this error :
SimpleDotComTestDrive.java:8: error: cannot find symbol
hu.setLocationCells(locations);
^
symbol: method setLocationCells(int[])
location: variable hu of type SimpleDotCom
SimpleDotComTestDrive.java:12: error: cannot find symbol
String result = hu.checkYourself(userGuess);
^
symbol: method checkYourself(String)
location: variable hu of type SimpleDotCom
2 errors
It's pretty annoying since I've searched over the internet for the past few hours and couldn't fix it, please, if you have any idea what's wrong with this then please let me know as soon as possible, thanks in advance !!!
LOOK !!!
i know notepad++ isn't the best IDE but the book recommended me to use simple IDE for learning purposes so please, don't ask me to use other IDE, thanks !
You mentioned that hu.setLocationCells(locations); which means that there needs to be a method setLocationCells() that takes int[] as parameter. Add that method for you to work.
By the way, Notepad++ is not an IDE at all. But yes, it's right to start with this. Good luck.
The variable hu which you are trying to use is declared in the main method in SimpleDotCom class and you are trying to access it from SimpleDotComTestDrive class. So the scope of hu is limited to main method itself.
Try declaring it at the class level, either static or instance variable and try to compile the code.

error while running java files

I have two files like read.java and sufer_type.java. The surfer_type.java needs some methods which are present in a .jar file. Before executing surfer_type.java I need to run read.java and use the data from read.java. So I used the statement:
read r=new read();
in surfer_type.java and I am compiling surfer_type.java like:
javac -classpath netcdfAll.jar surfer_type.java:
But I am getting an error:
surfer_netcdf.java:30: cannot find symbol
symbol : class read
location: class surfer_netcdf
read r = new read();
^
surfer_netcdf.java:30: cannot find symbol
symbol : class read
location: class surfer_netcdf
read r = new read();
You are trying to instantiate a class read, which it is telling you does not exist (or rather, it cannot find).
Make sure the class exists and is properly imported in the class where you are trying to use it.

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