How to build java classpath on Mac
Thank you.
Thanks. Maybe I didn't make myself clear.
I tried to compile java file in terminal window, it showed me error message, but when I tried to compile on Window, it works.
So I assume that I didn't set CLASSPATH correctly.
Today, my java files compiles fine. It's very strange.
Last semester I encountered that when I use eclipse to compile my java files, it showed me errors too, but the java files compile fine on Windows. This kind of thing happened from time to time.
I don't know did anyone else have this kind of problems too?
Similar Messages
-
How to execute Java.exe on MAC, LINUX, UNIX...
okay, I know this is very stupid, but can anybody tell me how to run Java.exe on MAC, LINUX, UNIX?
I know how to run it from windows, I have a batch file created in windows, will it work on MAC, LINUX and UNIX as well? (I'm not sure if on other OS, there is such a file type call *.bat)See what I mean about probably wanting a beginner's book on Unix and/or shell scripting?
okay crackers, the only thing that I have to do is put
in the name of my program into "your program here".Not necessarily. There's the ClassPath, program parameters, etc. What you need to put in the "your program here" depends upon your program. What I did was allow the script to be invoked with command-line parameters and you could (depending upon your program) put "-jar myjar.jar" in the indicated spot, if your JAR file was runnable.
The rest no need to change. right?I don't know. What does your program need? Only you can answer that, not me. I just furnished an example. -
Just read "Best of Macworld" article "How to disable Java on your Mac," in email dated 2/25/13. I'm a dinosaur running OS 10.4.11 and Java 1.5.0_19, which is earlier than the versions addressed in the article. Do I remove/isolate in the same manner? Will the effects of removal/isolation the same as described in the article?
Hello, if you're talking about disabling Java in say Safari...
Safari>Preferences>Security>uncheck/Disable Java in your Browser settings, not JavaScript. -
How can install java sdk for mac os x 10.6.8
How can install java sdk for mac os x 10.6.8?
Deanwdd wrote:
I mean to update Quicktime for Mac Os X 10.6.8...
If you're running 10.6.8, Apple menu > Software Update. What version of QT do you have? -
How to build JAVA script in CMD
How to build JAVA script in CMD command prompt?
I think it's build.all but it's not working plz helpTo build a Java class file (ie compile it) you need to call the Java compiler javac. There is software around to make this easier:
- ANT a make like tool but with XML files usually called build.xml
- Maven a more convention driven approach for much complexer systems
- IDEs like JDeveloper, Netbeans, Eclipse, you name it.
--olaf -
How to launch java files on Mac OS
Hey! I got a question: how to wrap a java file into Mac OS executable file? Analog for Windows is exe4j . It creates a jre in a exe file , so a person dont need to install runtime env. So any way to do like that? I need to launch program on Mac OS without terminal & installed jre. Just double-click on icon. Thanx for response.
jwenting wrote:
won't work. The question is how to execute a Java source file as a Mac executable.I don't think that's what the OP wants. To quote him:
I need to launch program on Mac OS without terminal & installed jre. Just double-click on icon.Sounds exactly as if he'd like to have an executable jar file. And since Mac OS X comes with a JRE preinstalled, there is no more magic necessary to make it easily usable. -
How Web AS Java Classpath be set ?
Hi, we are currently work on deployment of BEA Weblogic JMS adapter driver into XI 7.0 (Netweaver application server)
The OS is HP-UX.
After the deployment, we created a JMS adapter, however the error occured on creating initial context, it complains:
java.lang.NoClassDefFoundError.
We double checked that the class (used to create initial context), the class is inside the jar file we deployed.
It seems that the error is that the class loader can not find the jar file, I just wonder how to set CLASSPATH in application server to allow our class to loaded ?
Thanks and will reward points for those who help us solve the problem, or direct us to right directions.
LiangThe problem is that we have to deploy 8.x client driver in Neweaver Application server to connect BEA 9.2 server.
This is documented in OSS Note 1090516
Liang -
How to build Java ME code without GUI desktop and WTK?
I want to do application development for cell phones implementing MIDP and CLDC. I see that there is a sun java wireless toolkit available for this. However, it requires an X server or GUI desktop to execute the toolkit. I want a build environment where I can build my source files into Java code. So, what I need is just the necessary JAR files, preverify command, etc. Is there such a distribution from Sun?
For compiling use javac from standart JDK with your classpath.
And use preverify, jadtool, mekeytool utils from "JavaME platform SDK3.0" or WTK2.5.2 -
How to use java.nio on Mac?
I am getting the error "cannot find symbol" on "Path", "FIles", etc. I am using javac and java 1.8.0_20 on Mac OS X 10.9.2 and the Terminal. Thanks.
import java.io.*;
import java.nio.*;
class a{
public static void main(String args[]) throws IOException{
Path directorio = "/Users/Josue/Desktop/";
try {
DirectoryStream<Path> stream = Files.newDirectoryStream(dir);
for( Path file: stream ){
System.out.println(file.getFileName());
catch ( DirectoryIteratorException x ){
System.err.println(x);Before you answer, I got the solution (from somewhere else), it was because I didn't import explicitly the classes Files, Paths, etc.
But I don't understand why .* didn't work to do it? -
Hello! I need some help to download JAVA
Java is generally not a standard for seeing movies.
Also 10.5.8 Java is obsolete, and won't be updated. You need a minimum of Mac OS X 10.7.3 to really get full Java support. You can only update to 10.7.3 if you have an Intel Core2Duo with 2 GB of RAM or more.
Intel CoreSolo and Intel CoreDuo are NOT compatible.
Edit: If you do have a compatible machine with 10.7.3, here are other considerations before upgrading: https://discussions.apple.com/docs/DOC-6271
What website requires Java to see movies? Netflix uses Silverlight and Mac OS X 10.5.7 or higher.
Others just use plain Quicktime or Realplayer. You can also install some 32 bit versions of Windows 7 on your Mac if all you have is a CoreSolo or CoreDuo using some of the virtualization tools here, which might also support the video formats you are talking about:
https://discussions.apple.com/docs/DOC-2741 -
How we build Java Database Connectivity for Oracle 8i Database
Can any one send me a sample code for Java Database Connectivity for Oracle 8i Database
it will be a grat help
Thanks & Regards
RasikaYou don't need a DSN if you use Oracle's JDBC driver.
You didn't read ANY of the previous replies. What makes you think this one willk help? Or any instruction, for that matter?
Sounds like you just want someone to give it to you. OK, I'll bite, but you have to figure out the rest:
import java.sql.*;
import java.util.*;
* Command line app that allows a user to connect with a database and
* execute any valid SQL against it
public class DataConnection
public static final String DEFAULT_DRIVER = "sun.jdbc.odbc.JdbcOdbcDriver";
public static final String DEFAULT_URL = "jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\\Edu\\Java\\Forum\\DataConnection.mdb";
public static final String DEFAULT_USERNAME = "admin";
public static final String DEFAULT_PASSWORD = "";
public static final String DEFAULT_DRIVER = "com.mysql.jdbc.Driver";
public static final String DEFAULT_URL = "jdbc:mysql://localhost:3306/hibernate";
public static final String DEFAULT_USERNAME = "admin";
public static final String DEFAULT_PASSWORD = "";
/** Database connection */
private Connection connection;
* Driver for the DataConnection
* @param command line arguments
* <ol start='0'>
* <li>SQL query string</li>
* <li>JDBC driver class</li>
* <li>database URL</li>
* <li>username</li>
* <li>password</li>
* </ol>
public static void main(String [] args)
DataConnection db = null;
try
if (args.length > 0)
String sql = args[0];
String driver = ((args.length > 1) ? args[1] : DEFAULT_DRIVER);
String url = ((args.length > 2) ? args[2] : DEFAULT_URL);
String username = ((args.length > 3) ? args[3] : DEFAULT_USERNAME);
String password = ((args.length > 4) ? args[4] : DEFAULT_PASSWORD);
System.out.println("sql : " + sql);
System.out.println("driver : " + driver);
System.out.println("url : " + url);
System.out.println("username: " + username);
System.out.println("password: " + password);
db = new DataConnection(driver, url, username, password);
System.out.println("Connection established");
Object result = db.executeSQL(sql);
System.out.println(result);
else
System.out.println("Usage: db.DataConnection <sql> <driver> <url> <username> <password>");
catch (SQLException e)
System.err.println("SQL error: " + e.getErrorCode());
System.err.println("SQL state: " + e.getSQLState());
e.printStackTrace(System.err);
catch (Exception e)
e.printStackTrace(System.err);
finally
if (db != null)
db.close();
db = null;
* Create a DataConnection
* @throws SQLException if the database connection fails
* @throws ClassNotFoundException if the driver class can't be loaded
public DataConnection() throws SQLException,ClassNotFoundException
this(DEFAULT_DRIVER, DEFAULT_URL, DEFAULT_USERNAME, DEFAULT_PASSWORD);
* Create a DataConnection
* @throws SQLException if the database connection fails
* @throws ClassNotFoundException if the driver class can't be loaded
public DataConnection(final String driver,
final String url,
final String username,
final String password)
throws SQLException,ClassNotFoundException
Class.forName(driver);
this.connection = DriverManager.getConnection(url, username, password);
* Get Driver properties
* @param database URL
* @return list of driver properties
* @throws SQLException if the query fails
public List getDriverProperties(final String url)
throws SQLException
List driverProperties = new ArrayList();
Driver driver = DriverManager.getDriver(url);
if (driver != null)
DriverPropertyInfo[] info = driver.getPropertyInfo(url, null);
if (info != null)
driverProperties = Arrays.asList(info);
return driverProperties;
* Clean up the connection
public void close()
close(this.connection);
* Execute ANY SQL statement
* @param SQL statement to execute
* @returns list of row values if a ResultSet is returned,
* OR an altered row count object if not
* @throws SQLException if the query fails
public Object executeSQL(final String sql) throws SQLException
Object returnValue;
Statement statement = null;
ResultSet rs = null;
try
statement = this.connection.createStatement();
boolean hasResultSet = statement.execute(sql);
if (hasResultSet)
rs = statement.getResultSet();
ResultSetMetaData meta = rs.getMetaData();
int numColumns = meta.getColumnCount();
List rows = new ArrayList();
while (rs.next())
Map thisRow = new LinkedHashMap();
for (int i = 1; i <= numColumns; ++i)
String columnName = meta.getColumnName(i);
Object value = rs.getObject(columnName);
thisRow.put(columnName, value);
rows.add(thisRow);
returnValue = rows;
else
int updateCount = statement.getUpdateCount();
returnValue = new Integer(updateCount);
finally
close(rs);
close(statement);
return returnValue;
* Close a database connection
* @param connection to close
public static final void close(Connection connection)
try
if (connection != null)
connection.close();
connection = null;
catch (SQLException e)
e.printStackTrace();
* Close a statement
* @param statement to close
public static final void close(Statement statement)
try
if (statement != null)
statement.close();
statement = null;
catch (SQLException e)
e.printStackTrace();
* Close a result set
* @param rs to close
public static final void close(ResultSet rs)
try
if (rs != null)
rs.close();
rs = null;
catch (SQLException e)
e.printStackTrace();
* Close a database connection and statement
* @param connection to close
* @param statement to close
public static final void close(Connection connection, Statement statement)
close(statement);
close(connection);
* Close a database connection, statement, and result set
* @param connection to close
* @param statement to close
* @param rs to close
public static final void close(Connection connection,
Statement statement,
ResultSet rs)
close(rs);
close(statement);
close(connection);
}% -
HT1338 how can i run java on a Mac OS version 10.6.8?
My company runs it's email and agent portal through Java, wen I wen through the Java web page to download the software
it sends me to apple support, does anybody have an idea of how to run java on a Mac book Mac OS v10.6.8?
help me please my job is depending on this.Since August 2012 updates for Java (and especially Java Runtime Environment, which is what you actually need) must now be downloaded direct from Oracle:
http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1637588.h tml
Further information here:
http://www.oracle.com/us/corporate/press/1735645
and their FAQ’s:
http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/mac-faq.html
However, if you need the Jave 6 JRE and plug-in, MadMAC0 has posted at
https://discussions.apple.com/message/20107182?ac_cid=tw123456#20107182
Apple has also posted (Oct 22/12) the approved solution for restoring the Java 6 plug-in:
Java for OS X 2012-006: How to re-enable the Apple-provided Java SE 6 applet plug-in and Web Start functionality. -
How to do java class path on MAC
Hi
I have been trying to run a program on MAC, but it complain things like cant find java.io.FileReader and so on.
So how do I set classpath, so the program finds them.
please helphttp://java.sun.com/docs/books/tutorial/getStarted/cupojava/mac.html
-
How could i install Java on my Mac OS X 10.6.8 ?
Hello.
First of all I am French so please excuse me for my English.
I tried to install Java on my MAC but unfortunately the download of the software always meets the same problem... It asks me to be under mac OS X 10.7 but my computer does not propose me update. What should i do ?
Thank youhttp://support.apple.com/kb/DL1360
Note: Java 1.6 for Leopard is 64 bit only, but for Snow Leopard it is available for both 32 and 64 bit.
http://www.roguish.com/blog/?p=266
Since August 2012 updates for Java (and especially Java Runtime Environment, which is what you actually need) must now be downloaded direct from Oracle:
http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1637588.h tml
Further information here:
http://www.oracle.com/us/corporate/press/1735645
and their FAQ’s:
http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/mac-faq.html
However, if you need the Jave 6 JRE and plug-in, MadMAC0 has posted at
https://discussions.apple.com/message/20107182?ac_cid=tw123456#20107182
Apple has also posted (Oct 22/12) the approved solution for restoring the Java 6 plug-in:
Java for OS X 2012-006: How to re-enable the Apple-provided Java SE 6 applet plug-in and Web Start functionality.
Interesting article here on why Apple removed Mac browsers’ ability to run Jave Applets:
http://www.techweekeurope.co.uk/news/apple-java-browser-mac-os-x-96827 -
How to build a small application using Java API
Hai expertise,
I want to retreive MDM repository info using JAVA API, i am following these blogs:
/people/andreas.seifried/blog/2006/03/26/performing-free-form-searches-with-mdm-java-api
/people/udi.katz/blog/2005/08/21/retrieving-data-from-mdm-server-using-the-mdm-java-api
/people/udi.katz/blog/2005/07/17/mdm-connectivity-to-java-application
<b>where to get the jar and sda files to build the application??
In Developer Studio.. Windows -> Preferences -> Java -> Classpath variables. Is this the only place where we need to give the jar file path??
Are there any other configurations to do(except setting container variable to MDM4J jar file) to connect my java application to MDM repository???</b>
Regards,
Chand.Hi Govada,
(1)You need to add the MDM4j and other JAR files at:-
right click on project -> Java Build Path -> Libraries -> Add External JARs
(2)If the project is Web Dynpro project one
then right click on project -> Web Dynpro Reference -> Library Reference -> and add sap.com/com.sap.mdm.tech.mdm4j
Are you using JAVA API 1 or 2???
Thanking you
Namrata Dixit
Maybe you are looking for
-
Can't start a 2013 Workflow in an Event Receiver
I am trying to run a SP2013 workflow from an Event Receiver but I get the error "The request was aborted: The request was canceled. Client ActivityId: aec2fc1b-3f33-44d8-85ab-c6c976617b8c" at the point I actually attempt to start the Workflow. The sc
-
Where is the option to open private browsing in a single tab in Firefox 20?
I don't see the option.
-
Hi, When we do CK11N, the cost for the material is picking up from std. Price, where the matrial valuation in config is assigned first for Purcharse info record, where they have a PO for the material. Now the system is not picking up the PO price ins
-
Can I get a backlit keyboard for my Hp Pavilion M6-1054sa?
Hi I just got this laptop and sadly it didn't come with a backlit keyboard. I was wondering if it's possible to replace my current keyboard with a backlit? If this is possible, would you know where I could buy the parts needed and how to install them
-
Serial number not accepted lightroom MAC but works on windows
loaded a test version of lightroom on MAC. Tried to add the serial number but number was not accepted. Installed Lightroom on Windows PC and entered the serial number and this works fine. Why can I not add the same number on my MACbook?