• Advertisement
Sign in to follow this  

How to compile and execute Java program using Netbenas

This topic is 2389 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,

I have no experience in java or netbeans. I found this java program which I would like to execute and see. However I am not sure how to do it.

I am using netbeans 6.9.1 Can anyone help me compile and execute this program which I downloaded from here:
[url="http://www.pixelnerve.com/v/2009/02/08/ray-sphere-intersection/"]My link[/url]

It contain Java file, PDE file and a jar library.

Thanks

Share this post


Link to post
Share on other sites
Advertisement
[quote name='playstation' timestamp='1309830849' post='4831204']
Hi,

I have no experience in java or netbeans. I found this java program which I would like to execute and see. However I am not sure how to do it.

I am using netbeans 6.9.1 Can anyone help me compile and execute this program which I downloaded from here:
[url="http://www.pixelnerve.com/v/2009/02/08/ray-sphere-intersection/"]My link[/url]

It contain Java file, PDE file and a jar library.

Thanks
[/quote]

Extract the zip file to a directory.

In Netbeans, choose File->Open Project then navigate to your extracted file folder directory.

Click "Open Project Folder"

Share this post


Link to post
Share on other sites
Thanks for reply.

There is no option as open project folder? Open project if I got to destination there is only library folder from the extracted zip file.

I tried making a new project and add the vitamin lib and then java, pde file but nothing works

Share this post


Link to post
Share on other sites
Just create a new project "with existing sources"(should be selectable in netbeans new project dialog.
There u can select the source files(all *.java files) and after u created the netbeans project go to the project preferences(rightclick on the project icon).
There u can add the jar found in the libary folder to the project libarys.

I just saw that the project is using Processing, it's an java visualisation framework. [url="http://processing.org/"]http://processing.org/[/url]
To run the project u have to include the processing libs also in your classpath(as aboth with the vitamin.jar)

Share this post


Link to post
Share on other sites
Thanks I did that and also added vitamin and processing lib but while I try to run the program netbeans tell me no main classes found. Is this program compatible with processing-1.5.1 only ?

I donwloaded processing-1.5.1 (windows) and tried opening the program with it. It reads .pde file? Trying to run the program however I get an error in TexRrenderer.pde

as constructor TextRenderer (Font, boolean, boolean, null, boolean) is undefiend

[code]

class VTextRenderer
{
VTextRenderer( String fontName, int size )
{
_fontName = fontName;
_fontSize = size;
_textRender = new TextRenderer( new Font(fontName, Font.TRUETYPE_FONT, size), true, true, null, true );
_textRender.setColor( 1.0f, 1.0, 1.0, 1.0 );
//_textRender.setUseVertexArrays( true );
}

VTextRenderer( String fontName, int size, boolean antialiased, boolean mipmap )
{
_fontName = fontName;
_fontSize = size;
_textRender = new TextRenderer( new Font(fontName, Font.TRUETYPE_FONT, size), antialiased, true, null, mipmap );
_textRender.setColor( 1.0f, 1.0, 1.0, 1.0 );
//_textRender.setUseVertexArrays( true );
}
[/code]


I haven't done anything to the program so not sure why this is happening ...

Share this post


Link to post
Share on other sites
ok i took a deeper look at this, I know what processing is but nevver used it. So here it is what I think.

I think u can somehow start Processing and open the .pde files with it, then u will see some 3D graphics or so.

What do u want to do with the code u downloaded anyway? If u searched for an ray sphere interesection testing code snipped take a look at the VRay.java file

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement