I'm working with a Mac OSX version 10.9.5 and I am a complete newbie to using the command line and running java files in it.
I just downloaded the eps2pgf folder, I unzipped it and I downloaded JDK8.
However when I try to run the command (thats given in the manual) in my Terminal, I get the following error:
Unable to access jarfile eps2pgf.jar
The exact command I use is:
java -jar eps2pgf.jar Bifurcatiediagram.eps -o Bifurcatiediagram.pgf
So in total the command before I run it is (with what is automatically there as well):
mbpvanasteyaert:~ Aranka$ java -jar eps2pgf.jar Bifurcatiediagram.eps -o Bifurcatiediagram.pgf
What am I doing wrong? Should the eps2pgf unzipped folder be in a specific folder/directory or...?
Related
I'm trying to execute a Java file I was given on Windows 10, inside of the Bash shell.
I open my command prompt. I enter bash.
I set
JAVA_CALL="C:/Program Files/Java/jdk1.8.0_192/jre/bin/java"
I try to execute the call, but to no luck. I read several threads on here and tried several things. I made sure my path includes both the Program Files x86 and the regular Program Files version of my JAVA.
I executed
sudo ln -s -f /mnt/c/Program\ Files/Java/jre1.8.0_192/jre/bin/java.exe /bin/java
To try and make a link to it. I cannot get it to wrong. It always tells me
-bash: C:/Program Files/Java/jdk1.8.0_192/jre/bin/java: No such file or directory
I am sure that file exists. Any ideas?
I'm attempting to run CPUSIM under ubuntu 16.4
java -cp .:richtextfx-fat-0.6.10.jar:reactfx-2.0-MR.jar
-jar CPUSim-4.0.11.jar
Is the line the readme file says to enter in, when i try using that line the program fails. I'm not that versed with java or runtime stuff under ubuntu. I'm trying to run it in a terminal that's in the file directory where i unzipped the file.
Any tips on using -cp with java in a terminal?
I have NetBeans 8.0.2 installed on my Windows 7 (64-bit) machine. I have also the JDK installed (Java SE Development Kit 8 update 66 (64-bit)).
I want to run ant from the command line, but the closest I think I've come to getting it to run is the following:
java -jar "C:\Program Files\NetBeans 8.0.2\extide\ant\lib\ant.jar"
but I got the error
Error: Could not find or load main class org.apache.tools.ant.Main
I also tried the following, thinking that Main.class might be inside ant.jar, but got the same error:
java -cp "C:\Program Files\NetBeans 8.0.2\extide\ant\lib\ant.jar" -jar "C:\Program Files\NetBeans 8.0.2\extide\ant\lib\ant.jar"
I've spent at least an hour searching online and StackOverflow for the anser. The closest I've found is Compile NetBeans project from command line by using Ant, but it assumes that ant is accessible from the command line already.
To set up ant to work from the command line
Add C:\Program Files\NetBeans 8.0.2\extide\ant\bin to your PATH
Add the environment variable JAVA_HOME with the value C:\Program Files\Java\jdk1.8.0_66 (adjust this if you end up using a different version, of course).
Now that it is set up, simply use ant from the command line normally.
To rebuild the project, for example, simply do the following:
Open a new command prompt
Go to the project directory
Type ant clean jar
I have developed an application which results serial ports in combobox, but when I am running .jar file of my application using command terminal using command:
Java -jar Serial_Send.jar //where Serial_Send is name of my jar file
It is resulting into an error Cannot find javax.comm.properties.
But javax.comm.properties file is present in java_home/jre/lib directory.
What else I have to do in order to resolve this.
Try the following command:
java -jar -Djava.class.path=java_home/jre/lib Serial_Send.jar
This will put the lib directory in class path of program explicitly.
I have a jar file named test.jar, which I am running with a batch script from the same folder.
Here's the batch code:
java -jar test.jar
pause
The jar itself works with no problems, and I can run it just fine.
However, if I try to run the batch file as an administrator (by right clicking it and choosing "Run as Administrator"), I get the following error:
Error: Unable to access jarfile test.jar
I'm using Windows 8.1, but this also happened on a machine running Windows 7.
What can I do to be able to run this as an Administrator?
i had the same problem that you and i solved it by changing
java -jar test.jar
to
java -jar %~dp0test.jar
%~dp0 holds the directory of your bat file (AFAIK) so %~dp0 will give Java the full path to the jar file solving the problem.
You could also ad a temp path to java
path=C:\Program Files\Java\jre1.8.0_40\bin
Java script
path=