Package org.pdfbox.pdfparser does not exist - pdfbox

There is following portion in my code:
import org.pdfbox.cos.COSDocument;
import org.pdfbox.pdfparser.PDFParser;
import org.pdfbox.pdmodel.PDDocument;
import org.pdfbox.pdmodel.PDDocumentInformation;
import org.pdfbox.util.PDFTextStripper;
When I try to compile, it saws following error:
package org.pdfbox.pdfparser does not exist.
I have installed the default JDK on Ubuntu so how do I solve this issue?

This is not part of the default JDK installation. You need to get hold of the jar file that contains this code and then add it to your compile-time class path.
so, if you were to download the jar file to /tmp/pdfbox.jar, you'd compile it with
javac -cp .:/tmp/pdfbox.jar MyProgram.java
PS - downloading it to /tmp isn't a great idea, but you get the picture ......

you must build path it into your lib folder
go to your package explorer and right click on jar file and after that use build path

Related

Python wheel installed successfully but unable to import modules

I have a myFunction.pyd file which I have tested to make sure that modules defined internally are accessible.
I then created a wheel file myFunction-1.0-py3-none-any.whl
Finally using cmd prompt I installed the wheel file. I can then also see the following location:
C:\Program Files\Python38\Lib\site-packages\myFunction-1.0.dist-info
However, when I do the following import myFunction as mf it gives error ModuleNotFoundError: No module named 'myFunction'
Only thing I can think of is I didn't do anything with the pyd file that I had generated. Do I need to also move that file to some location?

Tensorflow(GPU) in sublime text 3

I tried to install tensorflow and finally got there.
I got an error:
ImportError: libcudnn.Version: cannot open shared object file: No such
file or directory
while I was installing but I could handle it. I think it works fine in terminal.
However, the problem is when I tried to import tensorflow in sublime text, it spits the same error.
ImportError: libcudnn.so.6: cannot open shared object file: No such
file or directory
Cause I changed the build system path to /home/username/.conda/envs/tensorflow/bin, I can't understand why I get this error here.
Is there anyone who can help me?
As it is working from terminal I think everything like cuda, cudnn and GPU drivers are setup properly and the export path is added to the .bashrc (~/.bashrc) file. That's why running from terminal works. As adding the export information to only .bashrc file will make it work on terminal but won't help for other programs like sublime.
So, I suggest, you take the export information from .bashrc file and add it to /etc/environment file. You need to log out from current user and login again so environment variables changes take place. The export information on .bashrc file should look something like this.
export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64\${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

Import package from other intelliJ project

I have a development folder with the following folders (projects) inside it:
development: { baseByBase, vgo, virology-lib2}
Files in virology-lib2 are packaged with package ca.virology.lib2..;
Files in vgo are packaged with package ca.virology.vgo..;
So in my baseByBase project importing from virology-lib2 with import ca.virology.lib2...; works.
I want to import classes similarly from vgo into baseByBase, but import ca.virology.vgo..; doesnt work (cannot resolve symbol vgo). How do i import vgo classes into baseByBase? Why did it work for one import and not the other?
In IDEA terms, you have a project with three modules in it. In order one of them (baseByBase) to import classes from the others, it must depend either on the modules or on their output (jars). The third, ugly option is baseByBase module to have among its configured "source" folders a folder from another module (virology-lib2).
So open "File > Project Structure", and add "vgo" as a module dependency to the "baseByBase" module (see example in the screenshot below).

how to install a package in golang

I try to connect to SQL server in golang, I searched in internet and through this address: https://github.com/denisenkom/go-mssqldb I understood that first I need to install a package for the purpose, but when I want to install this package through git terminal by entering this command:
$ go get github.com/denisenkom/go-mssqldb
I receive this error :
can't load package: package github.com/denisenkom/go-mssqldb: no buildable go source files in C:\Go\src\github.com\dnisenkom\go-mssqldb
my $GOPATH is already set.I don't know how to fix this problem ...
According to the golang website:
Get downloads and installs the packages named by the import paths, along with their dependencies.
It sounds like the download isn't working, which is causing the folder to be empty. One alternative is to download the driver as a zip file and run go install on the folder.

Can't import google_play_services-lib using eclipse

I re-installed google_play_services successfully and I have google_play_services-lib in my workspace. When I try to import it as a project in eclipse I use File-> Import->Existing Projects into Workspece -> Next -> Select root directory and then I find and select google_play_services-lib but finally it says "no project found to import". Why is that? How can I import this lib into eclipse?
I forgot to mention that I followed the steps at http://developer.android.com/google/play-services/setup.html
If I understand correctly then the reason you cannot import it is because you have already imported it. If the Google Play Services code is outside Eclipse and you have updated those directories then the job is done !
However if you copied the code into the Eclipse workspace then the easiest approach may be to delete the GPGS lib from Eclipse and then import again.
Had the same Problem. What I did:
File -> Import -> Android -> Existing Android Code Into Workspace
That worked for me.