Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Problems Moving Project from NetBeans to Eclipse(Project runs with NetBeans on Mac but not with Eclipse, at least 2 problems)
Problems Moving Project from NetBeans to Eclipse [message #1620283] Tue, 17 February 2015 04:57 Go to next message
David Rogers is currently offline David RogersFriend
Messages: 25
Registered: August 2014
Junior Member
I am new to both Eclipse and the Mac, have a MacBook Pro with OS X 10.10 Yosemite. Had been developing a project using Java and PostgreSQL on a Dell Win 7 with NetBeans. Due to several reasons I decided to bite the bullet and move to a Mac 1) to make some changes and additions to the present project and 2) to develop a related project under Eclipse. (Other folks who might further develop these project are working with Eclipse; thus, I felt I should work in only one SDK - Eclipse to make things simpler for myself and others in the future.)

I installed NetBeans 8.0.2 SDK on the Mac. The identical program developed under NetBeans works both on the Win 7 and on the Mac.

However, when I moved the code for the present project into Eclipse (Luna 4.4.1) there are several errors, indicated in my bracketed comments below.
Error 1:
package ui;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
//import java.awt.print.PrinterException; // this I can take care of
import java.sql.*;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import org.postgresql.util.PSQLException;
[above: the above import cannot be resolved]
import java.nio.file.Files;
import java.io.*;
import java.util.ArrayList;

[line 23: ] public class Globals extends javax.swing.JFrame implements ActionListener {
[above: "The serializable class Globals does not declare a static final serialVersionUID field of type long" - deprecated??]
public static ArrayList<String> searchTerms = new ArrayList<>();
public static String outputToWhere = "";
static JFrame frame;
public static Connection con = null;

[The second error is the following, on below: "Class is a raw type. References to generic type Class<T> should be parameterized." - this is something completely new to me; I never saw this in the old NetObjects.]
[line 164:] public static Class loadDriver(String driverName) {
try {
return (Class.forName(driverName));
} catch (ClassNotFoundException e) {

[The following is the third error, which I have been trying to solve, but do not know where to find the CLASSPATH on the Mac.
"Class is a raw type. References to generic type Class<T> should be parameterized." same as above. -- Note: this works with NetObjects on the Mac. I get a "unresolved compilation problem" on line 190.]
[line 190:] public static void sign_on() {
Class driverClass = loadDriver("org.postgresql.Driver");
if (driverClass == null) {
return;
}
System.out.println("Connection successful");
con = connectURL("jdbc:postgresql://localhost/pg1",
"postgres", "ginkat8a");
[How do I set the CLASSPATH in Eclipse on the Mac? Where is it?]

Help will be greatly appreciated.
Re: Problems Moving Project from NetBeans to Eclipse [message #1620737 is a reply to message #1620283] Tue, 17 February 2015 11:46 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 02/16/2015 09:57 PM, David Rogers wrote:
> I am new to both Eclipse and the Mac, have a MacBook Pro with OS X 10.10
> Yosemite. Had been developing a project using Java and PostgreSQL on a
> Dell Win 7 with NetBeans. Due to several reasons I decided to bite the
> bullet and move to a Mac 1) to make some changes and additions to the
> present project and 2) to develop a related project under Eclipse.
> (Other folks who might further develop these project are working with
> Eclipse; thus, I felt I should work in only one SDK - Eclipse to make
> things simpler for myself and others in the future.)
>
> I installed NetBeans 8.0.2 SDK on the Mac. The identical program
> developed under NetBeans works both on the Win 7 and on the Mac.
> However, when I moved the code for the present project into Eclipse
> (Luna 4.4.1) there are several errors, indicated in my bracketed
> comments below. Error 1:
> package ui;
> import java.awt.event.ActionEvent;
> import java.awt.event.ActionListener;
> //import java.awt.print.PrinterException; // this I can take care of
> import java.sql.*;
> import javax.swing.JFrame;
> import javax.swing.JOptionPane;
> import org.postgresql.util.PSQLException;
> [above: the above import cannot be resolved]
> import java.nio.file.Files;
> import java.io.*;
> import java.util.ArrayList;
>
> [line 23: ] public class Globals extends javax.swing.JFrame implements
> ActionListener {
> [above: "The serializable class Globals does not declare a static final
> serialVersionUID field of type long" - deprecated??]
> public static ArrayList<String> searchTerms = new ArrayList<>();
> public static String outputToWhere = "";
> static JFrame frame;
> public static Connection con = null;
>
> [The second error is the following, on below: "Class is a raw type.
> References to generic type Class<T> should be parameterized." - this is
> something completely new to me; I never saw this in the old NetObjects.]
> [line 164:] public static Class loadDriver(String driverName) {
> try {
> return (Class.forName(driverName));
> } catch (ClassNotFoundException e) {
>
> [The following is the third error, which I have been trying to solve,
> but do not know where to find the CLASSPATH on the Mac. "Class is a raw
> type. References to generic type Class<T> should be parameterized."
> same as above. -- Note: this works with NetObjects on the Mac. I get
> a "unresolved compilation problem" on line 190.]
> [line 190:] public static void sign_on() {
> Class driverClass = loadDriver("org.postgresql.Driver");
> if (driverClass == null) {
> return;
> }
> System.out.println("Connection successful");
> con = connectURL("jdbc:postgresql://localhost/pg1",
> "postgres", "ginkat8a");
> [How do I set the CLASSPATH in Eclipse on the Mac? Where is it?]
>
> Help will be greatly appreciated.

Welcome to the Eclipse community.

"The serializable class..."
"Class is a raw type..."

You can turn these warnings/errors off. Go to Window -> Preferences ->
Java -> Compiler -> Errors/Warnings, and find the setting. You can
adjust these, turning what are added protections off, to be only
warnings or to be errors as you wish.

These are really Java questions and not so much Eclipse questions. You
should take the time to check out the reason behind each of these.
Google is your friend or you can ask at javaranch.com.

Best of luck.
Re: Problems Moving Project from NetBeans to Eclipse [message #1623192 is a reply to message #1620737] Thu, 19 February 2015 01:00 Go to previous messageGo to next message
David Rogers is currently offline David RogersFriend
Messages: 25
Registered: August 2014
Junior Member
Thanks.
I got rid of the raw stuff.

Now I'm off to solve what I think is the CLASSPATH problem. I can't find where to put it on this new machine.

Will try javaranch.com.

Again, many thanks.
Re: Problems Moving Project from NetBeans to Eclipse [message #1623234 is a reply to message #1620737] Thu, 19 February 2015 01:41 Go to previous messageGo to next message
David Rogers is currently offline David RogersFriend
Messages: 25
Registered: August 2014
Junior Member
Thanks.
I got rid of the raw stuff.

Now I'm off to solve what I think is the CLASSPATH problem. I can't find where to put it on this new machine.

Will try javaranch.com.

Again, many thanks.
Re: Problems Moving Project from NetBeans to Eclipse [message #1624782 is a reply to message #1623234] Fri, 20 February 2015 01:22 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 02/18/2015 06:41 PM, David Rogers wrote:
> Thanks.
> I got rid of the raw stuff.
>
> Now I'm off to solve what I think is the CLASSPATH problem. I can't find
> where to put it on this new machine.
>
> Will try javaranch.com.
>
> Again, many thanks.

It's not a CLASSPATH issue, it's a Java 5 versus Java pre-5 issue. You
don't use

Class

anymore, but instead

Class< something here >

depending on what you're doing with it. You might use

Class< ? >

depending and assuming what you're doing won't blow chunks when you're
holding something you didn't expect.

You see, it's really a Java question. I hope you got help.

Cheers
Re: Problems Moving Project from NetBeans to Eclipse [message #1746236 is a reply to message #1620283] Tue, 25 October 2016 20:01 Go to previous message
David Rogers is currently offline David RogersFriend
Messages: 25
Registered: August 2014
Junior Member
absolved.
Previous Topic:Java Virtual Memory Usage at Eclipse startup
Next Topic:Installing Lucene
Goto Forum:
  


Current Time: Fri Mar 29 06:27:44 GMT 2024

Powered by FUDForum. Page generated in 0.03949 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top