LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-03-2013, 01:49 PM   #1
stevorobs3
LQ Newbie
 
Registered: Jul 2013
Posts: 6

Rep: Reputation: Disabled
Unable to access jarfile spl.jar


Hi,

I am new to both Linux and programming and am trying to follow the stanford course - CS106B. I have managed to install an IDE (netbeans, the C++ version) and am trying to run a program. The program builds fine but when I run it, I get the message "Unable to access jarfile spl.jar".

Netbeans has build the file into an executable (application/x-executable) called cs106b and somewhere underneath this is the spl.jar file which it cannot access.

I have also tried the same thing using the eclipse environment, tried running the executable file from the terminal (even using sudo) and changed the permissions of the file in question but still get the same error.

Could someone advise as to what I'm doing wrong?

Thanks in advance!
 
Old 08-03-2013, 02:41 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
The first thing to do is to find out where spl.jar is and if it exists then examine its permissions. You can find spl.jar with this command:

find / -iname "*spl.jar*"

This find command will search your entire filesystem and could take a while.

-----------------------
Steve Stites

Last edited by jailbait; 08-03-2013 at 02:43 PM.
 
Old 08-04-2013, 04:36 AM   #3
stevorobs3
LQ Newbie
 
Registered: Jul 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jailbait View Post
The first thing to do is to find out where spl.jar is and if it exists then examine its permissions. You can find spl.jar with this command:

find / -iname "*spl.jar*"

This find command will search your entire filesystem and could take a while.

-----------------------
Steve Stites

Thanks for your reply. I did that search and the file exists in 2 locations:

/home/stevorobs3/NetBeansProjects/Assignment1-linux/0-Warmup/spl.jar
/home/stevorobs3/NetBeansProjects/Assignment1-linux/0-Warmup/StanfordCPPLib/spl.jar

I had already changed the file permissions of these to:

-rwxrwxrwx 1 stevorobs3 stevorobs3 412533 Jan 9 2013 spl.jar

I was wondering, could it be that I am not adding the .jar library correctly into my netBeans project?

Thanks for your help,

Steve
 
Old 08-04-2013, 06:22 AM   #4
larrykeenan
Member
 
Registered: Apr 2004
Location: Brisbane Australia
Distribution: UBUNTU 13.04
Posts: 61

Rep: Reputation: 19
Hi I am new to JAVA myself but was forced to learn
some of about a week ago as I needed to make a program
for those that don't own Adobe Acrobat to inject flash
auto-responder forms into their pdfs.

In both netbeans and eclipse, Your libraries need to be in two places.
When netbeans compiles, by default all external libraries are put in a
separate lib folder. eclipse compiles all to the one jar file.

The two places by default are project/lib/ and project/dist/lib/
That would probably be :
/home/stevorobs3/NetBeansProjects/Assignment1-linux/0-Warmup/lib/
/home/stevorobs3/NetBeansProjects/Assignment1-linux/0-Warmup/dist/lib/

I am going to give you another simple thing you will come across with
eclipse. Imagine you put some images in your project instead of text.
We are adding file.gif to a button. In eclipse we create a new source
folder using the file new menu and import file.gif to that folder.

You also have to copy it to root of your project bin folder.

When you use it don't mention the source folder because when compiled
it will be placed in the root of the jar along with your other jar files.
eg.
Code:
createImageIcon("/file.gif"));
Sorry for the long reply but it drove me batty for a couple of hours.

Have a great day!
Larry Keenan
 
Old 08-04-2013, 08:44 AM   #5
stevorobs3
LQ Newbie
 
Registered: Jul 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by larrykeenan View Post
The two places by default are project/lib/ and project/dist/lib/
That would probably be :
/home/stevorobs3/NetBeansProjects/Assignment1-linux/0-Warmup/lib/
/home/stevorobs3/NetBeansProjects/Assignment1-linux/0-Warmup/dist/lib/



Larry Keenan
Hi Larry,

Thanks for your reply, unfortunately I still get the same result. I made sure that a copy of spl.jar was in the above to folders you mentioned but I still get the same error. Is that what I should have done?

Thanks,

Steve
 
Old 08-04-2013, 09:42 AM   #6
larrykeenan
Member
 
Registered: Apr 2004
Location: Brisbane Australia
Distribution: UBUNTU 13.04
Posts: 61

Rep: Reputation: 19
I know exactly what you have done wrong now.

In netbeans just drag and drop one assignment folder to start your project.
In this case the 0-Warmup folder Not all of them.

I visited http://www.stanford.edu/class/cs106b/ to check directory layout
Have a Great Day!
Larry Keenan
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Unable to access jarfile MOVE.jar. Installing Mobility model generator in VANET dalalami21 Linux - Software 2 01-30-2013 11:19 PM
unable to access jarfile randosa Linux - Newbie 1 06-12-2012 03:32 PM
error- unable to access jar file fachhoch@gmail.com Linux - Newbie 2 05-31-2012 08:24 PM
How to set mail.jar(JavaMail) and mysql-connector-java.jar in Linux class path Terry56 Linux - Software 3 01-19-2010 09:06 AM
Fedora Core 1 Associating .jar files with java -jar command pymehta Fedora 0 01-13-2005 05:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration