Solved

Running/Compiling *.java (Java 5.0) file in Oracle Sql Devleloper

Posted on 2007-03-27
12
1,254 Views
Last Modified: 2013-12-12
I have installed Oracle Sql Developer 1.1.2.25.70 with Java Platform 1.5.0_10 on Fedora 5.

Is it possible to compile and run a *.java file without connecting the Oracle Sql Developer to a database?

If it is possible how do i do this?
0
Comment
Question by:gram77
  • 7
  • 5
12 Comments
 
LVL 20

Expert Comment

by:gatorvip
ID: 18800067
I don't really understand your question. You want to compile a .java file in SQL Dev? That's not what the app is for...  Also, SQL Dev doesn't come with the JDK, just the JRE.
0
 

Author Comment

by:gram77
ID: 18800093
So you mean you can't develop java applications in Oracle Sql Developer.

Oracle Sql Developer needs JDK preinstalled. before installing Sql Developer.
0
 

Author Comment

by:gram77
ID: 18800101
However, Sql Developer is able to understand all Java Keywords correctly as it prints them i blue..
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 20

Accepted Solution

by:
gatorvip earned 500 total points
ID: 18800239
If you have the JDK preinstalled, you don't *need* SQL Developer to compile .java files. You can use notepad for that, in the worst case. SQL Developer is to be used for database development, running queries, etc.

http://www.oracle.com/technology/products/database/sql_developer/index.html

***
 Oracle SQL Developer is a free graphical tool for database development. With SQL Developer, you can browse database objects, run SQL statements and SQL scripts, and edit and debug PL/SQL statements. You can also run any number of provided reports, as well as create and save your own. SQL Developer enhances productivity and simplifies your database development tasks.
****

However, if you *really* want to use SQL Dev for java compilation, you can customize behavior under Tools/Preferences.
- Tools/External Tools/New then enter the path to the javac.exe compiler you want to use
0
 
LVL 20

Expert Comment

by:gatorvip
ID: 18800250
You can definitely customize SQL Dev to recognize keywords, Tools/Preferences/Code Editor/Syntax Colors
0
 

Author Comment

by:gram77
ID: 18800574
gatorvip:

I addes javac as an external tool.

It shows in the Tools menu as well as the context menu on right clicking.

It compiles the java program well.

However, when i run the .java program, it raises the error:

"The target cannot be started because there is no active project"
0
 

Author Comment

by:gram77
ID: 18800748
well i have added java i.e.
/usr/java/jre1.5.0_10/bin/java as an external tool too.

However, when i run Writer2.java class file, i get the following error.
/usr/java/jre1.5.0_10/bin/java /mnt/win/linux_bkup/scripts/java/Writer2
Exception in thread "main" java.lang.NoClassDefFoundError: /mnt/win/linux_bkup/scripts/java/Writer2

/usr/java/jre1.5.0_10/bin/java Writer2
Exception in thread "main" java.lang.NoClassDefFoundError: /mnt/win/linux_bkup/scripts/java/Writer2
0
 

Author Comment

by:gram77
ID: 18800778
However, in Fedora Terminal Window, i get the desired result:
[root@localhost java]# /usr/java/jre1.5.0_10/bin/java Writer2
12
howdy
folks
0
 
LVL 20

Assisted Solution

by:gatorvip
gatorvip earned 500 total points
ID: 18801601
you will have to modify your classpath for your executables to work
0
 

Author Comment

by:gram77
ID: 18801803
gatorvip:
Modify the classpath in Fedora or Sql Developer.
You mean i should change the classpath in Sql Developer to the resemble classpath in Fedora?
0
 
LVL 20

Expert Comment

by:gatorvip
ID: 18802966
well, you can use it as a parameter directly in SQL Dev:

java -cp <your_classpath> (don't forget to include the current directory ".")
0
 

Author Comment

by:gram77
ID: 18813422
gatovip:
Wow! i am able to work on java using Oracle Sql Developer.

I am able to compile and run java source files :)

Many Thanks.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
create a nested synonym 4 28
Database Design Dilemma 6 58
SYS password changed. Now can't log in as SYS 27 28
Using SQL*PLUS issue with where statement with trunc function 3 27
In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question