Christopher Laurenzano

Ranch Hand
+ Follow
since Jul 25, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
3
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Christopher Laurenzano

Campbell -- I'm unfamiliar with the which command.  Could you show me how to use it in this context?  

Tom Holloway --

I don't quite understand.  I'm not using an IDE -- I just use TextMate for now.   I've always downloaded the JDK from Oracle's site, and i've had no problems before this.  The download on the Oracle site is a .dmg file.  I've always just downloaded it and installed it with no problem.


Campbell -- update.  I looked up the command in the man pages, but i'm on my linux machine right now.  But I assume you mean

which -a java

am I correct?
1 year ago
Something interesting --

I went to the oracle website and was able to download and install every version of java up to and including 16.  I thought maybe i was so out of date that this might help.   But when I downloaded and installed java 17 and 18 both it didn't find it when I enter the command java -version.

The command

which java -version

yields the result

/usr/bin.

I'm still at a loss as to what's going on.

I downloaded java 18 from Oracle.  It's the SE development kit, it has everything.  It's the same thing i've done with previous versions.
1 year ago
Ok , i just noticed something.  I went to my MB pro and entered

echo $JAVA_HOME and there's a blank line, yet when I enter

java -version

It comes up with Java 18, the latest version that I downloaded, so on this machine it properly set it, but on my iMac it didn't.

The MB pro is running High Sierra -- could that mean something?  
1 year ago
Campbell Ritchie --

No, the spaces were here in the post.  

Here are the results of your questions:

java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b16, mixed mode)

javac -version
javac 1.8.0_112

echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

echo JAVA_HOME
(Blank Line)

And os x is UNIX, the BSD version.
1 year ago
Tim Moores --

There is no value for that.  I've been away from UNIX and the command line for a while, so I've been reading up on it.   I've also come across the java_home command, but when i enter that on the command line it says command not found.

I'm not clear on how to use the JAVA_HOME variable, and which file to put it in.

It's really weird, because I was able to install Java 18 on my MB pro -- but then again, I updated to High Sierra, and it's there when i enter java -version.  Yet on my iMac the Java 18 folder is there, in /Library/Java/Java Virtual machines/JDK 18.02 (installed the latest update, but again it only sees java 1.8 when java -version is entered at the command line.
1 year ago
Campbell ...

I don't remember.   I did a search of all my posts and it didn't come up in any thread.   Perhaps I thought I did, but forgot to post.  That's all I meant.
1 year ago
I thought I posted this topic, but maybe not, because I can't find it, so I'll ask it again just in case.  my apologies if it's still here somewhere.

I downloaded and installed Java 18 on my 11,6 iMac, 2010, quad core i7running el capitan.  I have a backlight issue, so I got an external monitor after a few years, and luckily I can still use the machine.  

However, when I entered java -version in the terminal, it says the default version is java 8.   I looked in the Library directory (/Library/Java/Java Virtual Machines) and sure enough the folder for Java 18 is there, but for some reason it isn't being 'seen' or chosen as the default java version.  in the past when I've installed java (like on my MB Pro just recently) in updated find and Java 18 is the default version.

I'm having to read up again on Unix, but I can't figure out where the necessary file/command -- whatever it is -- that determines the default Java version is.  it has to be somewhere, given the above statement.

Has anyone else had this problem, and can they offer any advice on how to fix this?   I simply want to make Java 18 the default version.
1 year ago
I didn't mean that I was using Java 8.  I meant the tutorial that covered this topic was for java 8.   I'm on Java 18 and I'm getting this message.  Could there be something in the code that could cause this?
1 year ago
I'm going through  the demos in the tutorials -- for example, I downloaded the code re: GridLayout.  I tried to compile it, and got this message:

Note: GridLayoutDemo.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

Was wondering if anyone could tell me what this means.  I can't run the  demo.   The tutorials say this is for Java 8, so maybe that has something to do with it.  Any suggestions?

I thought I had posted this reply, but it isn't there for some reason, so my apologies if I'm posting it again.
1 year ago
Yes I am -- it's flow layout, the default one for a JPanel.  I'm just still learning these things, and am still getting used to the API's.  My apologies if  my question is too obvious.  I take it that there's something in the layout Manager to do this, but I thought there might be other ways to put the components where I want them, rather than have the Layout Manager take care of it, if I'm saying that correctly.
1 year ago
I'm working bit by bit on my contacts program, and am trying to figure out how to place a JLabel and a JTextField next to one another2 as well as place the field I want (Name, phone, address, etc) aligned to the left  Can anyone help?

Here's a screen shot so far.  The Field and label change being next to one another or on top depending on how small the window is reduced.



1 year ago
So can you tell me how to Uninstall the version of Java 18 that I have on my machine so I can start over again? I just mean the commander command at the command line that will do this? And do I need to be in the directory where the file is in order to do it?
1 year ago
Um...I have another problem here.

I'm using the code app in elementary os, and decided to write some test programs, rather than use the program that was written in Java 18.

here's the code for my hello program:

This complies and runs fine.

BUT....

For this brief TestWindow program to display a GUI:



I get the same error messages as before:

xception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-17-openjdk-amd64/lib/libawt_xawt.so
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2393)
at java.base/java.lang.Runtime.load0(Runtime.java:755)
at java.base/java.lang.System.load(System.java:1953)
at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:388)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:232)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:174)
at java.base/jdk.internal.loader.NativeLibraries.findFromPaths(NativeLibraries.java:315)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:285)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2398)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:818)
at java.base/java.lang.System.loadLibrary(System.java:1989)
at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:1392)
at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:1390)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
at java.desktop/java.awt.Toolkit.loadLibraries(Toolkit.java:1389)
at java.desktop/java.awt.Toolkit.initStatic(Toolkit.java:1427)
at java.desktop/java.awt.Toolkit.<clinit>(Toolkit.java:1401)
at java.desktop/java.awt.Component.<clinit>(Component.java:624)
at TestWindow.buildWindow(TestWindow.java:8)
at TestWindow.main(TestWindow.java:16)

Something else is going on here, but I don't know what.  I'm kind of tired and may be missing something, but if not, does anyone have any ideas?  I wrote this program on a machine that's running Java 17 open jdk, and this is the result.   So maybe it's not the version that's the problem.  It has something to do with the "Unsatisfied Link Error."  Don't know what that is and/or how to fix it.  I followed all the instructions to install  open JDK 17 from linuxCapable.  So I'm not sure what's missing.

Please help if you can.
1 year ago
OK, some more help if anyone can give it -- i think I downloaded it properly -- I had to use the tar download.  It's in my /opt folder, /opt/java-18.0.1.1.  But when  type java -version it says that version 17 is the current version.  It's in the /usr/bin/lib directory.   I'd like to make version 18 the default version, but not sure how to do it, because if I type the --config java command it says that 17 is the only version, and there's nothing to configure.


1 year ago
Okay, so can you tell me the difference (was looking at the page you linked) between the debian package an the RPM?  I did some looking around and a Ubuntu site said it's not possible to interchange the two.   It says I need to use the debian package, if I read it correctly.

my apologies for so many posts here.
1 year ago