Pygame Subset for Android not finding javac - java

I'm trying to install Pygame Subset for Android on my Linux machine, using Ubuntu 14.04. I've installed java and added it the the PATH, so I can type javac -version and get the version, verifying that it is installed (it is javac 1.7.0_79 for reference). However, running the PGS4A script ./android.py installsdk gives a long list of errors ending in Without a working JDK, I can't continue. But I have installed the jdk, I am even able to compile the test program test.java in the PGS4A directory. Why doesn't this work?

Related

JAR file I created runs only on computers with JDK installed

I recently created an application using the NetBeans IDE. I deployed it and created a jar file that runs perfectly on my computer and any computer that has the Java JDK installed, but when I try to run it on another computer that only has the JRE installed it says:
"Error: A JNI error has occurred, please check your installation and try again"
and then
"A Java Exception has occurred."
If you have JDK that you used to create jar with version1 and jre with version2 then you will encounter this kind of error.
For example:
If i used Java JDK 12 installed on my computer#1 to create jar.
At the same time, I had Java 8 (JRE) Installed on my friends computer.
So on my friend's computer it is not working because it has jre8..
I typed the follow commands to troubleshoot :
On computer#1 :
javac -version
// this gave me Java 12
On computer#2
java -version
// this gave me Java 8
In other words, my program is getting compiled with Java 12 (computer1)and I am trying to run with Java 8 on computer2.
To solve the problem, try running jar on same version of java used for development. Means match jdk and jre version.

javac NotRecognized - Java version 1.8.0_161 |

I'm testing out some code on a computer running Windows 8.1.
I'm using the command prompt and I can't seem to get javac (or javaC) to compile my text file. I've added the path as an environment variable (...\bin) and it doesn't do work. java -version and java prints information to the console, just can't get javac to work.
Seems like you are having JRE installed on your machine. You can go to your JAVA_HOME/bin folder, check if javac file is there or not. If not, it means you have JRE installed. You need to install java JDK.
FOr download jdk, this is the url for JDK 8:
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Previous version available here:
http://www.oracle.com/technetwork/java/archive-139210.html

Java installation in mac

I am new to mac. Running the javac / java -version command yields negative result. However, I do see java under system preferences. I have not installed JDK/JRE yet. On clicking the java icon, under update, it shows that the system has the recommended version of java. Java 8 update 144. What is the java icon doing under system preferences when I have not installed JDK/JRE.
It is JRE, which comes along with OS by default. I'm not sure, how did you executed java -version command. In my case, I get proper information about installed JRE.
You probably need to check your User and System variable under Java
Also, it is obvious to get error when executing javac without installing JDK.

Mac OS ElCapitan: java -version command not working

I'm trying to make Standford NER package to work on my mac. Using anaconda and python 2.7 (iPython notebook). I was following the steps given here:
http://www.nltk.org/api/nltk.tag.html#module-nltk.tag.stanford. While executing the last step, it gave me UnsupportedClassVersionError.."xy.z" is "52.0" which means I need to upgrade to java 8.
I upgraded to Java 8, but my java -version command still showing java 7. So I tried to fix it using the solution given here: After upgrading to Java8, javac still shows 1.7. Instead of removing, I renamed the directory. These are the following commands I exec:
cd /System/Library/Frameworks/JavaVM.framework/Versions/
mv Current Current_Old
ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/ Current
Then after that java -version command is not working. I realized the directory name is incorrect and tried to replace it back using mv Current_Old Current, still the command is not working.
how can I restore my java?
Able to get it working again! All I did was restored legacy Java 6 from this link: https://support.apple.com/kb/DL1572?locale=en_US
Then java -version was even showing me the latest version which is Java 1.8. Able to start Java IDE now.

How do I uninstall Java 1.6 from my Mac?

I just got a Mac so I am struggling with the basics. Initially I installed Java 1.6 to my Mac - Yosemite OS. Then I installed the latest 1.8 version. When I do a java -version from the command line it still says 1.6. How do I get rid of 1.6 completely? Being a new Mac user I don't even know where Java is installed on my machine or how to remove programs from my computer. Can anyone help?
I just had a similar issue. I modified the instructions I found at Macworld and set aside some of Apple's Java installation.
Since I wasn't comfortable flat out deleting components of Apple's Java installation, I made a directory on my desktop:
mkdir -p ~/Desktop/java-old/System/Library
Then, I moved the JVMs and other components out of the way
sudo mv /System/Library/Java ~/Desktop/java-old/System/Library
From there, I verified a new installation of Java 1.8. (nb: This was just j2se, not the full JDK). One other note, you'll still likely have parts of the Apple installed Java at /System/Library/Frameworks/JavaVM.framework and at /usr/bin/java. I have not evaluated the safety of removing or altering the contents of those directories.

Categories