R Nordstrom

Greenhorn
+ Follow
since Oct 08, 2019
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
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 R Nordstrom

Hi,    I have recently moved my development work from NetBeans8/JDK1.8 to NetBeans11/JDK11.

A significant number of errors are now present in the code generated by the GUI builder.

Here is the first:

C:\adata\java\NB11\J3-10\src\REN\My_Frame.java:736: warning: [rawtypes] found raw type: JList
 Output_Type = new javax.swing.JList();
 missing type arguments for generic class JList<E>
 where E is a type-variable:
 E extends Object declared in class JList

I have found that the error can be solved if the JList is deleted from the gui builder, and then manually rebuilt.  However, this is very tedious,
and there is always the possibility that I can introduce bugs into code that is already working.

Is there a simpler way to fix these gui builder issues ?

Thank you
Roy
       
1 week ago
Hi Every one,

I figured out the root problem.  Netbeans 9, 10 and early 11, have a bug.  When the clean/build is executed it does not add the appropriate Class-Path line to the manifest file.  Also it does not create the lib folder for your library jars.  This problem was solved in Netbeans 11.2.  By installing Netbeans 11.3 I now have a good command line launch in win7 and ubuntu 18.04.

Thank you
Roy
2 weeks ago
I found a Class-Path line in a project jar from my NetBeans-8 projects.


This is what my manifest file contained:

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.9.4
Created-By: 1.8.0_40-b26 (Oracle Corporation)
Class-Path: lib/jssc.jar lib/jna-4.1.0.jar lib/commons-math3-3.6.1.jar
X-COMMENT: Main-Class will be added automatically by build
Main-Class: REN.My_Frame

So now I need to figure out why Netbeans-10 is not adding this line, or modify my current project jar/manifest file.  

I am not sure how to do either of these, but at least I know what is wrong.  

Roy
3 weeks ago
Hi,

I opened J3-09.jar with 7-zip.   This is the contents of MANIFEST.MF

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.10.4
Created-By: 11.0.2+9-LTS (Oracle Corporation)
X-COMMENT: Main-Class will be added automatically by build
Main-Class: REN.My_Frame


I do not see a Path-Class statement. Do I need one ?

Thank you
Roy
3 weeks ago
Hi,

This is where I am at:   My project (J3-09) runs great on netbeans10 (JDK11) and my windows7 machine.

However, This is what I see at the command line:

C:\dist2>java -jar J3-09.jar
Error: Unable to initialize main class REN.My_Frame
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/math3/
linear/RealVector

I have 2 jar library files in the dist2 folder:    commons-math3-3.6.1.jar, and jssc.jar

My research indicates that my main class is not able to find the jar libraries.    

What is the best way to solve this ?

Note that a solution also needs to be deployable to my Ubuntu 18.04 machine.

Thank you
Roy
3 weeks ago
Thank you very much for your assistance.  For the time being I will confine my tests to the home network.

Thank you.  That sounds like a productive path to take.  I had no idea there were internal and external IP addresses.  I will do some research and get back in a few days.
Hi, Here are the 2 IP addresses I tried with my client

java -jar CapitalizeClient.jar 192.168.1.173

java -jar CapitalizeClient.jar 2602:252:d2a:bda0:f557:b22b:fe2e:7cdf

Just to clarify:  CapitalizeServer was running on my home wifi router when I tried to launch CapitalizeClient on my office machine.

Thank you
Roy


Hi,  I am in the process of teaching myself some basic networking code.

The tutorial I am working through right now has a server app (CapitalizeServer.java) operating on a laptop using Ubuntu 18.04
When I luanch this app in the terminal window it announces that it is executing and waiting for a connection.  This laptop is using
a wifi connection to my AT&T home wifi router.

Note: The IPV4 address of the ubuntu laptop, acting as my server, was read from settings / wifi / my at&t router section.  

At home, my win7 machine is being used as the client.  It is connected to the wifi router, but not with wifi.  It is using the ethernet connection to
this router. Then I use a batch file (capclient.bat) to launch CapitalizeClient.java.   This batch file contains the IPV4 address of the target server.

Basically, the client tries to connect to to the server at the given IP address. When this is successful, both the server and the client
announce this with brief messages in their respective terminal windows.  If text is typed into the terminal window of the win7 client, and the enter key is then
pressed, the server echoes this text back to the client in uppercase.

In my home environment all of this works perfectly with IPV4, and IPV6.  However, if the client is moved to my office win7 machine (about 25 miles away)
I get an error message stating "connection has time out".  The office win7 machine, acting as the client, is connected to the office ethernet.

I have no idea how to address this issue.

Here is the code for the CapitalizeServer and CapitalizeClient.

Thanks for the help.

Roy









Hi,
This is my situation:  For a long time I have been using Netbeans 8, and Java SE 1.8.0.  I had no problems executing jar files from the command line.

Just a few month ago I loaded Netbeans 10, and java SE 11.0.2 onto my PC.  Netbeans 10 and the java 11 work well together.  

The problem occurs when I try to execute a jar file ( that was compiled with java 11 ) from the cmd line.  It generates lots of error messages about java version incompatability.  This I understand. It cannot execute a program compiled in the java 11 environment with a JRE from my old enviroment.

What I cannot figure out, is how configure my system so that the java 11 jar finds the java 11 JRE.

I tried appending the location of the  JDK 11.0.2 to my my PATH variable. This did not work.

Any help would be much appreciated.

Roy  
3 months ago
Hi,   I recently installed NetBeans 10 on my windows 7 PC.  A program called DateServer has been written and compiled on NB10.  If DateServer is run within the IDE, it operates fine.  However if I run DateServer from the command line it throws an error "UnsupportedClassVersionError".  

The JRE on my PC is SE 1.8.0_231

NB 10 is compiling with SE 11.0.2+9-LTS

Paraphrasing the error message:  DateServer has  been compiled with version 55.0, this java runtime only recognizes class file versions up to 52.0

I am hesitant to install the latest JRE on my machine since it may break operation of some legacy programs.

Is it possible to direct NB10 to compile DateServer with SE 1.8.0 ?  

Thank you for your help.

Roy
7 months ago
HI,

Switching from http to https worked very well.

Thank you very much for the help.

Roy
9 months ago
Hi,     I am attempting to run java code from one of the Oracle tutorials "Reading Directly from a URL".  The code cleans and builds OK.

My system consists of a Win7 PC that is connected to an AT&T  DSL wireless modem.  The ethernet cable on the DSL modem is connected to my PC.

When my jar file is executed from the command prompt, I am supposed to see scrolling of textual information.  There is no output in the command window, the code does not hang, and simply returns to the command line prompt.  

A note at the end of the tutorial says that if the desired output is not seen, I need to set the proxy host.  I have looked in my ISP's website for information, but this proved fruitless.

Could anyone provide some guidance on this ?

Thank you

Roy  





Reading Directly from a URL
After you've successfully created a URL, you can call the URL's openStream() method to get a stream from
which you can read the contents of the URL. The openStream() method returns a java.io.InputStream object,
so reading from a URL is as easy as reading from an input stream.
The following small Java program uses openStream() to get an input stream on the URL http://www.oracle.com/.
It then opens a BufferedReader on the input stream and reads from the BufferedReader thereby reading from
the URL. Everything read is copied to the standard output stream:
import java.net.*;
import java.io.*;

public class URLReader {
   public static void main(String[] args) throws Exception {

       URL oracle = new URL("http://www.oracle.com/";);
       BufferedReader in = new BufferedReader(
       new InputStreamReader(oracle.openStream()));

       String inputLine;
       while ((inputLine = in.readLine()) != null)
           System.out.println(inputLine);
       in.close();
   }
}
When you run the program, you should see, scrolling by in your command window, the HTML commands and
textual content from the HTML file located at http://www.oracle.com/. Alternatively, the program
might hang or you might see an exception stack trace. If either of the latter two events occurs,
you may have to set the proxy host so that the program can find the Oracle server.
9 months ago