Error in deleteing Java Temp file using Ghost4j sample code - java

Hi I tried to run http://ghost4j.sourceforge.net/highlevelapisamples.html PDF to PS sample code and it produce this error for me "ERROR: Temporary file /var/folders/8a/8a7E-LirFfeAJh+EC93W4U+++TY/-Tmp-/ghost4j/java.io.FileOutputStream#252f09991304994155878469 cannot be deleted" has anyone encounter this before and currently I am running on mac. Thanks!

Hi I had the same problem, but on windows 7..but I think is for the same reason.
problem was that ghost4j couldn't find the ghostscript libraries so it was failing here
result = GhostscriptLibrary.instance.gsapi_set_stdio(getNativeInstanceByRef().getValue(), stdinCallback, stdoutCallback, stderrCallback);
when trying to initialise the ghostscript libraries.
So I moved the library files to the directory in which I imported the sources.
As I'm running a 64 bit system I also had to change their name in "GhostscriptLibrary.java".
I found the library files installing ghostscript from http://downloads.ghostscript.com/public/
I'm quite sure is not the best way of solving the problem, but it worked for me.
hope it will help you.

Related

There's an error when installing Jdeveloper java.lang.Exception

hope you having a good day.
(Context of the problem ahead)
My problem is when installing JDeveloper suddenly appeared me an error log in the Oracle Universal Installer. Before this step of installation I passed an obstacle of the typically problem of the .zip file not founded (The error mentioned: Error to install Oracle JDeveloper). I changed the name of the .zip and then it seemed that I was on the right way of installing JDeveloper.
It's worth to highlight here, that I'm in Oracle Universal Installer. Because I can't still post images.
The problem here is that the file in fact exists and tells me that doesn't exists, it appears to indicate the path of the .zip file is: Disk2/stage/Components/oracle.ide.help.extras/12.2.1.4.0/DataFiles/filegroup1.jar
I already saw the .zip file without unzipping it and YES there's the .jar mentioned in the log:
I tried to download the same exact .zip file looking for if the file was missing in my .zip file, but I had the surprise that actually there it is.
So, if you have had the same problem I beg you to bring me help as needed as it is like from a colleague of you
I'm pendent of any response of you guys, hope you could help me. Beforehand, have a nice day.

Java opening files - works from Eclipse, doesn't work in runnable JAR/exe

I have some java code that I'm using to open a file:
Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + output.getAbsolutePath());
It works just fine when I execute it from Eclipse, however, when I export the project to a runnable JAR, the functionality stops working. I've tried various different options to open the file (Desktop.open, ProcessBuilder etc.) all with the same results (Eclipse OK, runnable JAR not).
This exact code previously worked when I exported it in the past (1.5 years ago). I believe that was with Java 1.6 and now we're on Java 1.7. Not sure if that's the reason though and I don't have the option to compile using previous versions of Java. Any ideas?
thanks for attempting to help. I figured out the answer which is quite simply that I'm an idiot :) Opening the file wasn't the problem, the file wasn't being written in the first place, and the reason it wasn't being written was quite simply because the code was set to write it into a nested folder structure which had not yet been created. I didn't even think of this because I assumed that any necessary folders specified in the output string would be created automatically. Doh!

run java program from cmd with class imports from jar files

Hey community I have this rookie problem so if anyone could help that would be great :)
So here it goes...
I'm trying to test the stanford NLP parser by trying to run the java demo file which is included in the file you can download from here
My problem is probably on the imports of the classes included in the .jar files..I tried the solutions on some other stackoverflow threads such as doing
javac -cp "jar/path/number/1";"jar/path/number/2" ParserDemo.java
but the
java -cp "jar/path/number/1";"jar/path/number/2" ParserDemo
command didn't work.
I also tried to extract every jar file in a common folder but then I got the bad class file error..
So what's the move here? How can I solve this ?
P.S. please don't propose as a solution to use the online version of the parser.
EDIT: I'm using Windows 8.1 just in case somebody needs to know
Since it was posted as a comment and I don't know if it would be visible for future reference I'm gonna write the solution down here as proposed by the user mlk
I fixed my java command to java -cp ".;jar/path/number/1";"jar/path/number/2" ParserDemo and it worked perfectly!
This is because the current folder (.) was not included in the classpath so Java could not see the ParserDemo.class file.

Package not found IntelliJ IDEA Skype4java

I've been so frustrated, I can't even begin writing my plugin because I'm having such problems getting a simple testcase to compile.
I followed the guide on IDEAs website to add the library, which seemed to be successful because IntelliSense detects the packages/classes, but then I come to compile.. and package not found
Here's a screenshot: any advice is greatly appreciated thanks.
As you can see, it appears to be picking up the lib in the IDE (detecting package/classes/methods etc.)
It seems you told IntelliJ that the library was the zip file containing all the distribution (sources, documentation, etc.). Extract the zip file, and make it point to the jar file that this zip probably contains.

VLCJ: Packaged Jar cant load libvlc library when double-clicked but runs perfectly through console

I have a problem with vlc.I am using Eclipse and have made a small application to play video files using vlcj framework.Inside Eclipse everything works fine but when I make jar executable file through Eclipse and double-clicking it (on Windows 64: Tested only on this platform) nothing happens .Then I'm trying using "cd myjarfilepath" and then "java -jar myjarname.jar" and everything works fine.Why this is happening and how to solve it?
Thanks in advance to stackoverflow's community .
Edit:
In Path Location: C:\Users\user\Documents\31\Latest_Win64\Needed I have the following files:
plugins(directory)
axvlc.dll
axvlc.dll.manifest
libvlc.dll
libvlc.dll.manifest
libvlccore.dll
npvlc.dll
npvlc.dll.manifest
vlc.exe.manifest
In my classpath i have included the following files:
jna-3.5.1.jar
platform-3.5.1.jar
vlcj-2.2.0.jar
vlcj-2.2.0-javadoc.jar
vlcj-2.2.0-sources.jar
This sounds like an issue loading the needed VLCj files. Not only are dlls required but the plugin directory is also required. As the execution location moves around from inside eclipse to back in the file system, the path to these files may be getting set incorrectly.
It sounds like you have it working within eclipse. This would indicate to me that what you have should work. Firstly, I would recommend acquiring the VLC dlls, etc., by providing this as a VM argument such as shown below, rather that setting it in code. Remember to comment out any loading you are doing in your code so that you are relying on the command line argument.
-Djna.library.path={Application Location}/lib
example: -Djna.library.path=C:/myapp/lib
Directory Contents:
lib
-- libblc.dll
-- libvlc5.dll
-- {etc}
/plugins
/3dnow
/access
{etc}
If you are still having issues, add the following argument to put VLCj into debug mode. This can be very helpful to determine where things are failing.
-Dvlcj.log=DEBUG
Hope that helps.

Categories